The <archiveClasses>
option has no effect.
Running mvn clean compile war:exploded
produces a war directory with .class files in the classes
directory, and they are not archived into a jar in the lib
directory neither. war:war
produces same result.
Plugin configuration:
...
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<archiveClasses>true</archiveClasses>
</configuration>
</plugin>
...
Workarounds?
Maven version 3.3.3, maven-war-plugin version 2.6.
JIRA ticket – https://issues.apache.org/jira/browse/MWAR-355
This is the project in question: https://bitbucket.org/dmos62/raudondvaris
The first thing is you should move the plain configuration into a
pluginManagement
block like this:If you do the above the classes will be created within the war archive by using:
mvn clean compile war:war
This will also working for your call
mvn clean compile war:exploded
.The reason for this behaviour is simply cause by using a goal like
war:war
, orwar:exploded
there will be no life cycle started which means the configuration in the pom is not taken into account. If you like having a configuration for your command line calls you can do this by using a special configuration for command line calls like this (The iddefault-cli
is the important part):which means having a special configuration for command line calls. Starting with Maven 3.3.1 it is possible having more than one configuration for command line calls by using it like:
This can be used by maven via the following:
See also the release notes for Maven 3.3.1.