i try to use the appassembler-maven-plugin to ease the use of the Java-Service-Wrapper
My Setup is as follows:
- implemented a class MyServiceWrapper which extends WrapperListner from JSW to have full access to the start/stop/controlEvent-methods
- added the appassembler-maven-plugin to my pom.xml and configured JSW
MyServiceWrapper:
package aaa.bbb.ccc;
import org.tanukisoftware.wrapper.WrapperListener;
import org.tanukisoftware.wrapper.WrapperManager;
public class MyServiceWrapper implements WrapperListener {
@Override
public void controlEvent(int arg0) {
}
@Override
public Integer start(String[] arg0) {
return null;
}
@Override
public int stop(int exitCode) {
return exitCode;
}
public static void main(String[] args) {
WrapperManager.start(new MyServiceWrapper(), args);
}
}
appassembler-maven-plugin in my pom.xml:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<id>generate-jsw-scripts</id>
<phase>package</phase>
<goals>
<goal>generate-daemons</goal>
</goals>
<configuration>
<!--declare the JSW config -->
<daemons>
<daemon>
<id>MyServiceWrapper</id>
<mainClass>aaa.bbb.ccc.MyServiceWrapper</mainClass>
<platforms>
<platform>jsw</platform>
</platforms>
</daemon>
</daemons>
<target>${project.build.directory}/appassembler</target>
</configuration>
</execution>
</executions>
</plugin>
This generates the wrapper.conf and a lot of other files! But there is one line which is wrong and i don't know how to generate it correctly.
The wrong line is:
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
and it should be:
wrapper.java.mainclass=aaa.bbb.ccc.MyServiceWrapper
If i manually set this line to the correct mentioned line it works!
So: is there any way to generate this line correctly?
PS: Is it possible to set the log-level of the JSW from inside the pom.xml?