Re: [SOLVED] maven-ear-plugin is not including jarModule into application.xml
mvn help:effective-pom is your friend here. S. On Thu, Aug 23, 2012 at 5:20 PM, Stuart Stephen stuart.step...@tracegroup.com wrote: I worked it out. I was being an idiot as usual. User error. Strangely it was producing the EAR file pretty much correctly, even though my plugin wasn't configured properly. I replaced... groupIdmaven-ear-plugin/groupId artifactIdmaven-ear-plugin/artifactId with... groupIdorg.apache.maven.plugins/groupId artifactIdmaven-ear-plugin/artifactId Then changed... includeLibInApplicationXmltrue/includeLibInApplicationXml to... includeInApplicationXmltrue/includeInApplicationXml Suddenly it did what I asked. Clever that. -Original Message- From: Stuart Stephen [mailto:stuart.step...@tracegroup.com] Sent: 23 August 2012 16:01 To: users@maven.apache.org Subject: maven-ear-plugin is not including jarModule into application.xml Hi, [This question is also on StackOverflow: http://stackoverflow.com/questions/12093346/maven-ear-plugin-is-not-including-jarmodule-into-application-xml] I've been following the example on the maven-ear-plugin site that [shows how to add third-party libraries to the generated application.xml][1]. However, it does not appear to be working as I expected. Similarly the web module [contextRoot][2] is being ignored. According to the [documentation][3] what I am trying to do should be entirely possible. The context root of a Web module might be customized using the contextRoot parameter. Please note that third party libraries (i.e. JarModule) are not included in the generated application.xml (only ejb-client should be included in a java entry). However, a jar dependency could be included in the generated application.xml by specifying the includeInApplicationXml flag. I have the following output when it executes the build in my application.xml. ?xml version=1.0 encoding=UTF-8? !DOCTYPE application PUBLIC -//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN http://java.sun.com/dtd/application_1_3.dtd; application display-nameMyApp.EAR/display-name module ejbMyApp.jar/ejb /module module web web-uriMyApp.war/web-uri context-root/MyApp.Web/context-root /web /module /application From the following maven configuraton (pom.xml). ... modelVersion4.0.0/modelVersion groupIdcom.blah/groupId artifactIdMyApp.EAR/artifactId version1.0/version packagingear/packaging build plugins plugin groupIdmaven-ear-plugin/groupId artifactIdmaven-ear-plugin/artifactId version2.7/version configuration applicationNameMyApp/applicationName modules ejbModule groupIdcom.blah/groupId artifactIdMyApp.EJB/artifactId /ejbModule webModule groupIdcom.blah/groupId artifactIdMyApp.Web/artifactId contextRootMyApp/contextRoot /webModule jarModule groupIdorg.slf4j/groupId artifactIdslf4j-simple/artifactId includeLibInApplicationXmltrue/includeLibInApplicationXml /jarModule /modules archive manifestEntries WebLogic-Application-Version${weblogic.version}/WebLogic-Application-Version /manifestEntries /archive /configuration /plugin /plugins /build dependencies !-- web and ejb modules -- dependency groupIdcom.blah/groupId artifactIdMyApp.EJB/artifactId version1.0/version typeejb/type /dependency dependency groupIdcom.blah/groupId artifactIdMyApp.Web/artifactId version1.0/version typewar/type /dependency /dependencies ... It is immediately obvious that the application.xml is not being generated as I intended. 1. The contextRoot supplied is not correct in the application.xml, instead the default name of MyApp.Web is output instead of the specified MyApp. 2. The org.slf4j jarModule specified is missing entirely from the application.xml. What am I doing wrong? Debug from Maven is shown below. [DEBUG] --- [DEBUG] Goal: org.apache.maven.plugins:maven-ear-plugin:2.4.2:generate-application-xml (default-generate-application-xml) [DEBUG] Style: Regular [DEBUG] Configuration: ?xml version=1.0 encoding=UTF-8? configuration description${project.description}/description displayName${project.artifactId}/displayName encoding default-value=UTF-8/
RE: [SOLVED] maven-ear-plugin is not including jarModule into application.xml
I worked it out. I was being an idiot as usual. User error. Strangely it was producing the EAR file pretty much correctly, even though my plugin wasn't configured properly. I replaced... groupIdmaven-ear-plugin/groupId artifactIdmaven-ear-plugin/artifactId with... groupIdorg.apache.maven.plugins/groupId artifactIdmaven-ear-plugin/artifactId Then changed... includeLibInApplicationXmltrue/includeLibInApplicationXml to... includeInApplicationXmltrue/includeInApplicationXml Suddenly it did what I asked. Clever that. -Original Message- From: Stuart Stephen [mailto:stuart.step...@tracegroup.com] Sent: 23 August 2012 16:01 To: users@maven.apache.org Subject: maven-ear-plugin is not including jarModule into application.xml Hi, [This question is also on StackOverflow: http://stackoverflow.com/questions/12093346/maven-ear-plugin-is-not-including-jarmodule-into-application-xml] I've been following the example on the maven-ear-plugin site that [shows how to add third-party libraries to the generated application.xml][1]. However, it does not appear to be working as I expected. Similarly the web module [contextRoot][2] is being ignored. According to the [documentation][3] what I am trying to do should be entirely possible. The context root of a Web module might be customized using the contextRoot parameter. Please note that third party libraries (i.e. JarModule) are not included in the generated application.xml (only ejb-client should be included in a java entry). However, a jar dependency could be included in the generated application.xml by specifying the includeInApplicationXml flag. I have the following output when it executes the build in my application.xml. ?xml version=1.0 encoding=UTF-8? !DOCTYPE application PUBLIC -//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN http://java.sun.com/dtd/application_1_3.dtd; application display-nameMyApp.EAR/display-name module ejbMyApp.jar/ejb /module module web web-uriMyApp.war/web-uri context-root/MyApp.Web/context-root /web /module /application From the following maven configuraton (pom.xml). ... modelVersion4.0.0/modelVersion groupIdcom.blah/groupId artifactIdMyApp.EAR/artifactId version1.0/version packagingear/packaging build plugins plugin groupIdmaven-ear-plugin/groupId artifactIdmaven-ear-plugin/artifactId version2.7/version configuration applicationNameMyApp/applicationName modules ejbModule groupIdcom.blah/groupId artifactIdMyApp.EJB/artifactId /ejbModule webModule groupIdcom.blah/groupId artifactIdMyApp.Web/artifactId contextRootMyApp/contextRoot /webModule jarModule groupIdorg.slf4j/groupId artifactIdslf4j-simple/artifactId includeLibInApplicationXmltrue/includeLibInApplicationXml /jarModule /modules archive manifestEntries WebLogic-Application-Version${weblogic.version}/WebLogic-Application-Version /manifestEntries /archive /configuration /plugin /plugins /build dependencies !-- web and ejb modules -- dependency groupIdcom.blah/groupId artifactIdMyApp.EJB/artifactId version1.0/version typeejb/type /dependency dependency groupIdcom.blah/groupId artifactIdMyApp.Web/artifactId version1.0/version typewar/type /dependency /dependencies ... It is immediately obvious that the application.xml is not being generated as I intended. 1. The contextRoot supplied is not correct in the application.xml, instead the default name of MyApp.Web is output instead of the specified MyApp. 2. The org.slf4j jarModule specified is missing entirely from the application.xml. What am I doing wrong? Debug from Maven is shown below. [DEBUG] --- [DEBUG] Goal: org.apache.maven.plugins:maven-ear-plugin:2.4.2:generate-application-xml (default-generate-application-xml) [DEBUG] Style: Regular [DEBUG] Configuration: ?xml version=1.0 encoding=UTF-8? configuration description${project.description}/description displayName${project.artifactId}/displayName encoding default-value=UTF-8/ generatedDescriptorLocation${project.build.directory}/generatedDescriptorLocation includeLibInApplicationXml default-value=false/ project${project}/project version default-value=1.3/ workDirectory${project.build.directory}/${project.build.finalName}/workDirectory /configuration [1]:
Re: [SOLVED] maven-ear-plugin is not including jarModule into application.xml
Hi Stuart, groupIdorg.apache.maven.plugins/groupId artifactIdmaven-ear-plugin/artifactId FWIW you can leave off the groupId if it begins with org.apache.maven.plugins and Maven will figure out what you mean. Very handy since the vast majority of the plugins you typically want to configure are the core ones from that groupId. -Curtis On Thu, Aug 23, 2012 at 10:20 AM, Stuart Stephen stuart.step...@tracegroup.com wrote: I worked it out. I was being an idiot as usual. User error. Strangely it was producing the EAR file pretty much correctly, even though my plugin wasn't configured properly. I replaced... groupIdmaven-ear-plugin/groupId artifactIdmaven-ear-plugin/artifactId with... groupIdorg.apache.maven.plugins/groupId artifactIdmaven-ear-plugin/artifactId Then changed... includeLibInApplicationXmltrue/includeLibInApplicationXml to... includeInApplicationXmltrue/includeInApplicationXml Suddenly it did what I asked. Clever that. -Original Message- From: Stuart Stephen [mailto:stuart.step...@tracegroup.com] Sent: 23 August 2012 16:01 To: users@maven.apache.org Subject: maven-ear-plugin is not including jarModule into application.xml Hi, [This question is also on StackOverflow: http://stackoverflow.com/questions/12093346/maven-ear-plugin-is-not-including-jarmodule-into-application-xml ] I've been following the example on the maven-ear-plugin site that [shows how to add third-party libraries to the generated application.xml][1]. However, it does not appear to be working as I expected. Similarly the web module [contextRoot][2] is being ignored. According to the [documentation][3] what I am trying to do should be entirely possible. The context root of a Web module might be customized using the contextRoot parameter. Please note that third party libraries (i.e. JarModule) are not included in the generated application.xml (only ejb-client should be included in a java entry). However, a jar dependency could be included in the generated application.xml by specifying the includeInApplicationXml flag. I have the following output when it executes the build in my application.xml. ?xml version=1.0 encoding=UTF-8? !DOCTYPE application PUBLIC -//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN http://java.sun.com/dtd/application_1_3.dtd; application display-nameMyApp.EAR/display-name module ejbMyApp.jar/ejb /module module web web-uriMyApp.war/web-uri context-root/MyApp.Web/context-root /web /module /application From the following maven configuraton (pom.xml). ... modelVersion4.0.0/modelVersion groupIdcom.blah/groupId artifactIdMyApp.EAR/artifactId version1.0/version packagingear/packaging build plugins plugin groupIdmaven-ear-plugin/groupId artifactIdmaven-ear-plugin/artifactId version2.7/version configuration applicationNameMyApp/applicationName modules ejbModule groupIdcom.blah/groupId artifactIdMyApp.EJB/artifactId /ejbModule webModule groupIdcom.blah/groupId artifactIdMyApp.Web/artifactId contextRootMyApp/contextRoot /webModule jarModule groupIdorg.slf4j/groupId artifactIdslf4j-simple/artifactId includeLibInApplicationXmltrue/includeLibInApplicationXml /jarModule /modules archive manifestEntries WebLogic-Application-Version${weblogic.version}/WebLogic-Application-Version /manifestEntries /archive /configuration /plugin /plugins /build dependencies !-- web and ejb modules -- dependency groupIdcom.blah/groupId artifactIdMyApp.EJB/artifactId version1.0/version typeejb/type /dependency dependency groupIdcom.blah/groupId artifactIdMyApp.Web/artifactId version1.0/version typewar/type /dependency /dependencies ... It is immediately obvious that the application.xml is not being generated as I intended. 1. The contextRoot supplied is not correct in the application.xml, instead the default name of MyApp.Web is output instead of the specified MyApp. 2. The org.slf4j jarModule specified is missing entirely from the application.xml. What am I doing wrong? Debug from Maven is shown below. [DEBUG] --- [DEBUG] Goal: org.apache.maven.plugins:maven-ear-plugin:2.4.2:generate-application-xml (default-generate-application-xml) [DEBUG] Style: Regular [DEBUG] Configuration: ?xml version=1.0