Duplicate classes wildfly maven plugin

171 Views Asked by At

I am using the wildfly-maven-plugin version 1.0.2.Final. When I run mvn install wildfly:deploy I get compilation errors for duplicate classes. These errors do not occur when I run the build without deploying.

2

There are 2 best solutions below

0
On

I solved my gradle build duplicate classes error (hamcrest-core) with this gradle codes :implementation ('junit:junit:4.12'){ exclude group: 'org.hamcrest', module:'hamcrest-core' }

It may help you.

0
On

At first I was running this command:

mvn clean install wildfly:deploy

I read the documentation and learned that wildfly:deploy invokes the package goal.

wildfly:deploy documentation

So I tried this command:

mvn clean wildfly:deploy

...and it deployed my war with no duplicate class errors.

The classes which originally were being duplicated are generated as a package from an external library. My guess is this package was being generated a second time when wildfly:deploy is called.