Dropwizard logging appender error - dropwizard

I have a dropwizard service which has been running for months with logging to console. I wanted to now log to file so I added the following extra lines to my config file:
logging:
# Permit DEBUG, INFO, WARN and ERROR messages to be logged by appenders.
level: INFO
appenders:
- type: file
currentLogFilename: ./log/taskiir-service.log
threshold: ALL
archive: true
archivedLogFilenamePattern: ./log/taskiir-service-%d.log
archivedFileCount: 5
timeZone: UTC
However when I try to run the service now I get the following error:
io.dropwizard.configuration.ConfigurationParsingException: taskiir-service.yml has an error:
* Failed to parse configuration at: logging.appenders.[0]; Could not resolve type id 'file' as a subtype of [simple type, class io.dropwizard.logging.AppenderFactory<ch.qos.logback.classic.spi.ILoggingEvent>]: known type ids = [] (for POJO property 'appenders')
at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: com.anton.taskiirservice.TaskiirService.TaskiirAPIConfiguration["logging"]->io.dropwizard.logging.DefaultLoggingFactory["appenders"]->java.util.ArrayList[0])
at io.dropwizard.configuration.ConfigurationParsingException$Builder.build(ConfigurationParsingException.java:276)
at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:157)
at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:92)
at io.dropwizard.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:124)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:72)
at io.dropwizard.cli.Cli.run(Cli.java:75)
at io.dropwizard.Application.run(Application.java:93)
at com.anton.taskiirservice.TaskiirService.TaskiirAPIApplication.main(TaskiirAPIApplication.java:59)
Caused by: com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'file' as a subtype of [simple type, class io.dropwizard.logging.AppenderFactory<ch.qos.logback.classic.spi.ILoggingEvent>]: known type ids = [] (for POJO property 'appenders')
at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: com.anton.taskiirservice.TaskiirService.TaskiirAPIConfiguration["logging"]->io.dropwizard.logging.DefaultLoggingFactory["appenders"]->java.util.ArrayList[0])
at com.fasterxml.jackson.databind.exc.InvalidTypeIdException.from(InvalidTypeIdException.java:43)
at com.fasterxml.jackson.databind.DeserializationContext.invalidTypeIdException(DeserializationContext.java:1615)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownTypeId(DeserializationContext.java:1186)
at com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase._handleUnknownTypeId(TypeDeserializerBase.java:291)
at com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase._findDeserializer(TypeDeserializerBase.java:162)
at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:113)
at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:97)
at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:254)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:287)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:244)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:519)
at com.fasterxml.jackson.module.afterburner.deser.SettableObjectMethodProperty.deserializeAndSet(SettableObjectMethodProperty.java:47)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:287)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:189)
at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserialize(SuperSonicBeanDeserializer.java:120)
at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedUsingDefaultImpl(AsPropertyTypeDeserializer.java:178)
at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:105)
at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:254)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:251)
at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserialize(SuperSonicBeanDeserializer.java:155)
at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3972)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2264)
at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:128)
... 6 more
Any ideas most welcome, thanks.
Here is the POM file (using Eclipse):
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<prerequisites>
<maven>3.0.0</maven>
</prerequisites>
<groupId>com.anton.taskiirservice</groupId>
<artifactId>TaskiirService</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>TaskiirAPI</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<dropwizard.version>1.2.2</dropwizard.version>
<mainClass>com.anton.taskiirservice.TaskiirService.TaskiirAPIApplication</mainClass>
<swagger.version>1.5.3-M1</swagger.version>
<jdk.version>1.8</jdk.version>
</properties>
<dependencies>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
<version>${dropwizard.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-jdbi</artifactId>
<version>${dropwizard.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.39</version>
</dependency>
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>5.3.2</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.7</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${mainClass}</mainClass>
</transformer>
</transformers>
<!-- exclude signed Manifests -->
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${mainClass}</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${mainClass}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
</plugin>
</plugins>
</reporting>
</project>

Related

Why does the wildfly server started from the wildfly-maven-plugin not shutdown?

I start a wildfly server from the wildfly-maven-plugin in order to perform integration-tests.
Every once in a while, the server does not shut down properly, and the java process does not terminate.
I get:
WARN [org.jboss.as.controller] (ServerService Thread Pool -- 24) JBAS014618: Graceful shutdown of the handler used for native management requests did not complete within [15000] ms but shutdown of the underlying communication channel is proceeding
Any idea how to fix this?
BR,
Stefan
I looked into the TRACE log of the server, but could not find something that helped me:
13:31:25,044 TRACE [org.jboss.as.naming] (MSC service thread 1-4) Unbound resource InAppClientContainer into naming store org.jboss.as.naming.ServiceBasedNamingStore#2dffc27b (service name service jboss.naming.context.java.module."webrules-1.0"."webrules-1.0".InAppClientContainer)
13:31:25,044 DEBUG [org.jboss.as.connector.logging] (MSC service thread 1-2) stopped ManagementRepositoryService service jboss.management_repository
13:31:25,044 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010418: Stopped Driver service with driver-name = h2
13:31:25,045 DEBUG [org.jboss.as.connector.deployment.registry] (MSC service thread 1-3) Stopping service service jboss.jdbc-driver.registry
13:31:25,098 TRACE [org.jboss.as.server.moduleservice] (MSC service thread 1-3) serviceStopping: Controller for service jboss.module.spec.service."deployment.webrules-1.0.war".main#498cd5bc
13:31:25,100 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment webrules-1.0.war (runtime-name: webrules-1.0.war) in 109ms
13:31:39,999 WARN [org.jboss.as.controller] (ServerService Thread Pool -- 24) JBAS014618: Graceful shutdown of the handler used for native management requests did not complete within [15000] ms but shutdown of the underlying communication channel is proceeding
13:31:40,001 DEBUG [org.jboss.as.protocol] (ServerService Thread Pool -- 24) cancelled operation (598837789) attachment: (null) this: org.jboss.as.protocol.mgmt.ManagementChannelHandler#741283d0.
This is the pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.mine</groupId>
<artifactId>webrules</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>webrules</name>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<servlet-api.version>4.0.1</servlet-api.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>2.0.1.Final</version>
<configuration>
<artifact>org.wildfly:wildfly-dist:8.2.1.Final:zip</artifact>
<java-opts>
<java-opt>-Dmyproperty=true</java-opt>
</java-opts>
<modules-path>
<paths>
<path>/opt/OC/share/wildfly/module</path>
</paths>
</modules-path>
<commands>
<command>/subsystem=logging/file-handler=debug:add(level=TRACE,autoflush=true,file={"relative-to"=>"jboss.server.log.dir", "path"=>"debug.log"})</command>
<command>/subsystem=logging/logger=org.jboss.as:add(level=TRACE,handlers=[debug])</command>
</commands>
</configuration>
<executions>
<execution>
<id>start-wildfly</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>execute-commands</goal>
<goal>deploy</goal>
</goals>
</execution>
<execution>
<id>stop-wildfly</id>
<phase>post-integration-test</phase>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>add-integration-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<!-- Configures the source directory of our integration tests -->
<sources>
<source>src/integration-test/java</source>
</sources>
</configuration>
</execution>
<!-- Add a new resource directory to our build -->
<execution>
<id>add-integration-test-resources</id>
<phase>generate-test-resources</phase>
<goals>
<goal>add-test-resource</goal>
</goals>
<configuration>
<!-- Configures the resource directory of our integration tests -->
<resources>
<!-- Placeholders that are found from the files located in the configured
resource directories are replaced with the property values found from the
profile specific configuration file. -->
<resource>
<filtering>true</filtering>
<directory>src/integration-test/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<excludes>
<exclude>**/*IntegrationTest</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<includes>
<include>**/*IntegrationTest</include>
</includes>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>install</phase>
<configuration>
<target>
<copy todir="../sa1/web-rules" overwrite="true">
<fileset
dir="target/${project.artifactId}-${project.version}"
includes="**">
</fileset>
</copy>
<copy todir="../sa2/web-rules" overwrite="true">
<fileset
dir="target/${project.artifactId}-${project.version}"
includes="**">
</fileset>
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<archive>
<manifestEntries>
<Dependencies>com.hpe.cms.smscapp.webrules-beans</Dependencies>
</manifestEntries>
</archive>
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.4.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.4.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.hpe.cms.smscapp</groupId>
<artifactId>webrules-beans</artifactId>
<version>1.2.8</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

How do I copy third-party jars to my target jar using Maven 3.6.0

I am trying to create a executable jar with Maven where all the third-party dependency jars are in the root. Included are two pics for examples, and my pom.xml
With this pom, I am getting this result just below it where the jars are broken out into folders.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http:// /xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.xmlrpc</groupId>
<artifactId>gz-xmlrpc-server</artifactId>
<version>1.1.0-RELEASE</version>
<packaging>jar</packaging>
<name>gz-xmlrpc-server</name>
<url>http://maven.apache.org</url>
<properties>
<java-version>1.7</java-version>
<target-java-version>1.7</target-java-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.maven.surefire/surefire-junit3 -->
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit3</artifactId>
<version>3.0.0-M3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.xmlrpc/xmlrpc-server -->
<dependency>
<groupId>org.apache.xmlrpc</groupId>
<artifactId>xmlrpc-server</artifactId>
<version>3.1.3</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<!-- mycompany -->
<dependency>
<groupId>com.mycompany.batch</groupId>
<artifactId>gz-batch-comptroller</artifactId>
<version>1.0.0-RELEASE</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.6.0</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>${java-version}</source>
<target>${target-java-version}</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<archive>
<manifest>
<addClasspath>false</addClasspath>
<Main-Class>com.mycompany.xmlrpc.server.Server</Main-Class>
</manifest>
<manifestEntries>
<Built-By>Michael Davidson</Built-By>
<Class-Path>.</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>com.mycompany.xmlrpc.server.Server</Main-Class>
<Class-Path>.</Class-Path>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<archive>
<manifest>
<mainClass>com.mycompany.xmlrpc.server.Server</mainClass>
</manifest>
<manifestEntries>
<Class-Path>. gz-batch-comptroller-1.0.0-RELEASE.jar</Class-Path>
</manifestEntries>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
</project>
Here is what I need with the full jars included.
I see other threads on this subject, and I believe my pom is correct. But, I can't seem to get there.
Thanks.
I am not sure why you are using all the 3 maven plugins - jar, shade and assembly.
Could you try using either shade or assembly plugin. You could also refer (if not already) following link to check these plugin usages:
Difference between maven plugins ( assembly-plugins , jar-plugins , shaded-plugins)
Please remove maven-assembly-plugin and maven-jar-plugin completely from pom.xml file and then just use maven-shade-plugin as follows:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Then run mvn clean package and check generated JAR file.

Jenkins - Maven(pom.xml) launch error: error in forked process

When i tried launch pom.xml from jenkins(as maven project) on ubuntu linux (14.x),i am getting below error. Please help me on same.
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test
(default-test) on project ui-test: Execution default-test of goal
org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed:
There was an error in the forked process [ERROR].
pom.xml:
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>com.siemens.fossology.test</groupId>
<artifactId>ui-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>ui-test</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.class>com.siemens.fossology.test.ui.StartUp</main.class>
<java.version>1.7</java.version>
<config-builder.version>1.3.1</config-builder.version>
<testng.version>6.9.8</testng.version>
<guava.version>18.0</guava.version>
<slf4j.version>1.7.7</slf4j.version>
<logback.version>1.1.2</logback.version>
<mockito.version>1.10.8</mockito.version>
<hamcrest.version>1.3</hamcrest.version>
<selenium-java.version>2.47.1</selenium-java.version>
<xml-apis.version>1.4.01</xml-apis.version>
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
<maven-jar-plugin.version>2.5</maven-jar-plugin.version>
<maven-assembly-plugin.version>2.4</maven-assembly-plugin.version>
<maven-shade-plugin.version>2.3</maven-shade-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>com.tngtech.java</groupId>
<artifactId>config-builder</artifactId>
<version>${config-builder.version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>${hamcrest.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>${mockito.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium-java.version}</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>${xml-apis.version}</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.2.201409121644</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>org/xmlsoap/schemas/**</exclude>
<exclude>org/apache/ws/commons/schema/**</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
<reuseForks>true</reuseForks>
<forkCount>1</forkCount>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.15</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${main.class}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>${main.class}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven-shade-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${main.class}</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.tooling</resource>
</transformer>
</transformers>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>with-dependencies</shadedClassifierName>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
The only time I've seen this error is when I've upgraded the maven compiler plugin (I happened to go from 3.5.1 to 3.6.0) and have been using the command line. I just had to do a mvn clean install and it fixed the error.

How to use custom *.ISS with javafx-ant, maven and INNO?

I am attempting to create a custom installer for my application using maven, inno and javafx-ant. I have looked at this link, but I do not seem to get the results described Inno and Maven
I have my installer successfully being created, and my application successfully installing. However it always goes to user/AppData/Local/. I have changed that in my custom *.iss file as follows:
DefaultDirName={pf}\cashreceipts
UsePreviousAppDir=No
Uninstallable=yes
However this file is not being picked up during the build. I have added the needed application-name.iss file at src/main/deploy/package/windows/application-name.iss however it's not picking up.
I am not sure what else to try to get this file used in my build.
Thanks!
The following is the maven configuration for the build step.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<!-- define the deploy ANT task -->
<taskdef name="jfxdeploy"
classname="com.sun.javafx.tools.ant.DeployFXTask"
classpathref="maven.plugin.classpath" />
<!-- define the JarSing ANT task -->
<!-- taskdef name="jfxsignjar"
classname="com.sun.javafx.tools.ant.FXSignJarTask"
classpathref="maven.plugin.classpath" / -->
<jfxdeploy outdir="${project.build.directory}/deploy"
outfile="${project.build.finalName}" nativeBundles="all"
verbose="true">
<info title="${project.name}" />
<!-- set the main class of your applcation -->
<application name="${project.name}"
mainClass="com.mycompany.myclass" />
<resources>
<fileset dir="${project.build.directory}"
includes="*.jar" />
<fileset dir="${project.build.directory}/dependency"
includes="*.jar" />
<fileset dir="${project.build.directory}"
includes="properties/*.properties"/>
</resources>
<!-- set your jvm args -->
<platform>
<jvmarg value="-Xms512m" />
<jvmarg value="-Xmx1024m" />
</platform>
</jfxdeploy>
<!-- you need to generate a key yourself -->
<!--jfxsignjar destdir="${project.build.directory}/deploy"
keyStore="path/to/your/keystore" storePass="yourPass"
alias="yourAlias" keyPass="keyPass">
<fileset dir="${project.build.directory}/deploy"
includes="*.jar" /> </jfxsignjar -->
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ant-javafx</artifactId>
<version>${javafx.version}</version>
<systemPath>${java.home}/../lib/ant-javafx.jar</systemPath>
<scope>system</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
<finalName>cashreceipts</finalName>
</build>
I was able to confirm that ZENJAVA plug in is still being worked on and is supported at github and it can accomplish this. The information is here:
JavaFX 8 - How to build EXE with Maven & INNO
My updated pom.xml looks like this:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>myapp</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>myapp</name>
<url>http://www.mycompany.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<javafx.version>8.0</javafx.version>
</properties>
<repositories>
<repository>
<id>repo</id>
<url>file://${project.basedir}/lib/repo</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<!-- new SNAPSHOT version needed to work with current JavaFX Version -->
<id>com.zenjava</id>
<url>file://C:\Users\username\Desktop\maven fx plugin\javafx-maven-plugin-master\javafx-maven-plugin-master\target</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<!-- copy all dependencies of your app to target folder -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<configuration>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifestEntries>
<Main-Class>com.mycompany.app.MyApp</Main-Class>
<implementation-version>1.0</implementation-version>
<JavaFX-Application-Class>com.mycompany.app.MyApp</JavaFX-Application-Class>
</manifestEntries>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
<!-- copy the properties files to the root location -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources-1</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/additionalResources/properties</outputDirectory>
<resources>
<resource>
<directory>properties</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.1.3-SNAPSHOT</version>
<configuration>
<mainClass>com.mycompany.app.MyApp</mainClass>
<verbose>true</verbose>
<bundler>EXE</bundler>
<additionalAppResources>${project.build.directory}/additionalResources</additionalAppResources>
</configuration>
<executions>
<!-- required before build-native -->
<execution>
<id>create-jfxjar</id>
<phase>package</phase>
<goals>
<goal>build-jar</goal>
</goals>
</execution>
<execution>
<id>create-native</id>
<phase>package</phase>
<goals>
<goal>build-native</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<finalName>myapp</finalName>
</build>
<dependencies>
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>8.40.9</version>
</dependency>
<dependency>
<groupId>customjar</groupId>
<artifactId>mycustomjar</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<organization>
<name>My Company</name>
<url>www.mycompany.com</url>
</organization>

Maven does not deploy application / start server after first run

I created a sample cxf service with following artifact. imported project in eclipse. Run As > maven install
It did execute compile>war> startserver> deploy war> execute test> stop server
Now after making some changes in code and test classes, when i do mvn install, it does not start/stop server, nor it deploys on tomcat. POM is as follows.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.domain.test.jaxrs</groupId>
<artifactId>jaxrs-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Simple CXF JAX-RS webapp service using spring configuration</name>
<description>Simple CXF JAX-RS webapp service using spring configuration</description>
<properties>
<jackson.version>1.8.6</jackson.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>default-cli</id>
<goals>
<goal>run</goal>
</goals>
<configuration>
<port>13000</port>
<path>/jaxrs-service</path>
<useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
<wtpmanifest>true</wtpmanifest>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>reserve-network-port</id>
<goals>
<goal>reserve-network-port</goal>
</goals>
<phase>process-test-resources</phase>
<configuration>
<portNames>
<portName>test.server.port</portName>
</portNames>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<executions>
<execution>
<id>start-tomcat</id>
<goals>
<goal>run-war</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<port>${test.server.port}</port>
<path>/jaxrs-service</path>
<fork>true</fork>
<useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
</configuration>
</execution>
<execution>
<id>stop-tomcat</id>
<goals>
<goal>shutdown</goal>
</goals>
<phase>post-integration-test</phase>
<configuration>
<path>/jaxrs-service</path>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.8.1</version>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<systemPropertyVariables>
<service.url>http://localhost:${test.server.port}/jaxrs-service</service.url>
</systemPropertyVariables>
</configuration>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
got it..."Convention over Configuration...." is the issue ....Test should run in integration-test phase. for this one should name test as *IT.java :)
This fixes issue.

Resources