Reputation: 141
I have tried everything to get this added to my application.xml file, but the maven-ear-plugin will just not recognize the application name property testEar in my pom file.
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.8</version>
<configuration>
<generateApplicationXml>true</generateApplicationXml>
<applicationName>testEAR</applicationName>
<earSourceDirectory>${basedir}/src/main/resources</earSourceDirectory>
<resourcesDir>target/classes</resourcesDir>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<modules>
<JarModule>
<groupId>org</groupId>
<artifactId>test-client</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</JarModule>
</modules>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
Upvotes: 5
Views: 5024
Reputation: 1047
I had the same problem, and in my case it turned out that Maven was not generating the application.xml file. The solution was removing from pom.xml the option:
<generateApplicationXml>true</generateApplicationXml>
The default value is "true", so this line was not necessary... and this somehow solved the issue
Upvotes: 0
Reputation: 141
I determined that the maven ear plugin by default was creating a non-EE6 application.xml, which does not support application-name.
I needed to add a new xml element (version) to the ear plugin to specify EE6.
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.8</version>
<configuration>
<generateApplicationXml>true</generateApplicationXml>
<applicationName>testEAR</applicationName>
<earSourceDirectory>${basedir}/src/main/resources</earSourceDirectory>
<resourcesDir>target/classes</resourcesDir>
<version>6</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<modules>
<JarModule>
<groupId>org</groupId>
<artifactId>test-client</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</JarModule>
</modules>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin> </plugins>
Upvotes: 9