The modules configuration is completely useless since the EAR plugin will build the modules list using the dependencies section of your EAR project.
You have a test-jar without a scope test so the ear plugin tries to package it since it's not scoped properly. On Fri, Jan 9, 2009 at 11:55 AM, Jaikiran <[email protected]>wrote: > > I am using Maven-2.0.9 in a multi-module project. One of the modules uses > the > maven-ear-plugin to generate an ear. Here's how it looks like: > > Parent pom.xml: > --------------------- > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd"> > > <artifactId>ParentArtifact</artifactId> > <version>0.1.0-SNAPSHOT</version> > <packaging>pom</packaging> > > <modules> > <!-- Create 2 jar files --> > <module>myjarOne</module> > <module>myjarTwo</module> > > <!-- Combine the above 2 jars into ear --> > <module>enterprise_Ear</module> > </modules> > > > > Module1 = Jar artifact: > --------------------- > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd"> > > <parent> > > <artifactId>ParentArtifact</artifactId> > > </parent> > > <artifactId>myjarOne</artifactId> > <version>0.1.0-SNAPSHOT</version> > <packaging>jar</packaging> > > > </project> > > > Module 2 = Jar artifact: > --------------------- > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd"> > > <parent> > > <artifactId>ParentArtifact</artifactId> > > </parent> > > <artifactId>myjarTwo</artifactId> > <version>0.1.0-SNAPSHOT</version> > <packaging>jar</packaging> > > > </project> > > > Module 3 = Ear artifact: > --------------------- > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd"> > > <parent> > > <artifactId>ParentArtifact</artifactId> > > </parent> > > <artifactId>enterprise_Ear</artifactId> > <packaging>ear</packaging> > > > <build> > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-ear-plugin</artifactId> > <configuration> > <modules> > <jarModule> > <groupId>blah.blah</groupId> > <artifactId>myjarOne</artifactId> > > </jarModule> > > <jarModule> > <groupId>blah.blah</groupId> > <artifactId>myjarTwo</artifactId> > > </jarModule> > </modules> > > </configuration> > </plugin> > </plugins> > </build> > > <!-- Dependencies --> > <dependencies> > > > <dependency> > <groupId>blah.blah</groupId> > <artifactId>myjarTwo</artifactId> > <version>someversion</version> > <type>jar</type> > </dependency> > > <dependency> > <groupId>blah.blah</groupId> > <artifactId>myjarOne</artifactId> > <version>someversion</version> > <type>jar</type> > </dependency> > > </dependencies> > </project> > > > When i run mvn clean package on the parent pom, i always get a > > [INFO] [ear:generate-application-xml] > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] Failed to initialize ear modules > > Embedded error: Unknown artifact type[test-jar] > > This happens irrespective of whether i include any "modules" in the ear > plugin configuration. No matter what i tried, i keep getting this error. I > then decided to run mvn in debug mode and this is what i see in the logs: > > [DEBUG] Resolving ear modules ... > [DEBUG] Resolving ear module[jar:blah.blah.blah:myjarOne] > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] Failed to initialize ear modules > > Embedded error: Unknown artifact type[test-jar] > [INFO] > ------------------------------------------------------------------------ > [DEBUG] Trace > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to > initialize > ear modules > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583) > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499) > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478) > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330) > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291) > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) > at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) > at > org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) > at org.codehaus.classworlds.Launcher.main(Launcher.java:375) > Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to > initialize ear modules > at > > org.apache.maven.plugin.ear.AbstractEarMojo.execute(AbstractEarMojo.java:210) > at > > org.apache.maven.plugin.ear.GenerateApplicationXmlMojo.execute(GenerateApplicationXmlMojo.java:96) > at > > org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451) > at > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558) > ... 16 more > Caused by: org.apache.maven.plugin.ear.UnknownArtifactTypeException: > Unknown > artifact type[test-jar] > at > > org.apache.maven.plugin.ear.util.ArtifactTypeMappingService.getStandardType(ArtifactTypeMappingService.java:159) > at > > org.apache.maven.plugin.ear.EarModuleFactory.newEarModule(EarModuleFactory.java:65) > at > > org.apache.maven.plugin.ear.AbstractEarMojo.execute(AbstractEarMojo.java:203) > ... 19 more > > > Anyone has any idea what's going on or what i might try to get this > working? > Let me know, if anyone needs more logs/configuration information. > > > -- > View this message in context: > http://www.nabble.com/maven-ear-plugin%3A-Always-throws-%22Embedded-error%3A-Unknown-artifact-type-test-jar-%22-tp21370128p21370128.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Large Systems Suck: This rule is 100% transitive. If you build one, you suck" -- S.Yegge
