Failed to create <application-name> entry with maven ear plugin

I tried everything to add this to my application.xml file, but the maven-ear plugin just doesn't recognize the testEar property of the application name 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> 
+4
source share
1 answer

I decided that the ear maven plugin by default created a non-EE6 application.xml that does not support the application name.

I needed to add a new xml element (version) to the ear plugin in order 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> 
+9
source

Source: https://habr.com/ru/post/1440848/


All Articles