Friday, 15 April 2011

eclipse - Creating war file failed from maven multi module project using java -



eclipse - Creating war file failed from maven multi module project using java -

i have parent maven project , two kid modules of parent. 1 of kid modules has packaging type of jar. , jar used in other kid module has packaging type of war.

first child's 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/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <parent> <groupid>com.zurel.myparent</groupid> <artifactid>myparent</artifactid> <version>0.0.1-snapshot</version> </parent> <artifactid>myfirstchild</artifactid> <packaging>jar</packaging> </project>

second child's 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/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <parent> <groupid>com.zurel.myparent</groupid> <artifactid>myparent</artifactid> <version>0.0.1-snapshot</version> </parent> <artifactid>myfirst</artifactid> <packaging>war</packaging> <dependencies> <!--other dependencies --> <dependency> <groupid>com.zurel.myparent</groupid> <artifactid>myfirstchild</artifactid> <version>0.0.1-snapshot</version> </dependency> </dependencies> </project>

when seek run bundle command in sec maven module, next error:

slf4j: failed load class "org.slf4j.impl.staticloggerbinder". slf4j: defaulting no-operation (nop) logger implementation slf4j: see http://www.slf4j.org/codes.html#staticloggerbinder farther details. [info] scanning projects... [info] [info] ------------------------------------------------------------------------ [info] building myfirst 0.0.1-snapshot [info] ------------------------------------------------------------------------ [warning] pom com.zurel.myparent:myfirstchild:jar:0.0.1-snapshot missing, no dependency info available [info] ------------------------------------------------------------------------ [info] build failure [info] ------------------------------------------------------------------------ [info] total time: 2.353s [info] finished at: thu jun 19 16:20:58 npt 2014 [info] final memory: 5m/100m [info] ------------------------------------------------------------------------ [error] failed execute goal on project myfirst: not resolve dependencies project com.zurel.myparent:myfirst:war:0.0.1-snapshot: not find artifact com.zurel.myparent:myfirstchild:jar:0.0.1-snapshot -> [help 1] [error] [error] see total stack trace of errors, re-run maven -e switch. [error] re-run maven using -x switch enable total debug logging. [error] [error] more info errors , possible solutions, please read next articles: [error] [help 1] http://cwiki.apache.org/confluence/display/maven/dependencyresolutionexception

pom of both kid modules fine. however, kindly ensure next done: 1) both kid modules added in parent module (aggregator module) modules 2) aggregation module has packaging type of 'pom' 3) run 'mvn clean install on parent module

sample parent pom :

http://maven.apache.org/maven-v4_0_0.xsd">

<modelversion>4.0.0</modelversion> <groupid>org.test</groupid> <artifactid>myparent</artifactid> <packaging>pom</packaging> <version>1.0-snapshot</version> <name>myparent</name> <url>http://maven.apache.org</url> <modules> <module>../firstchild</module> <module>../secondchild</module> </modules>

java eclipse maven maven-module

No comments:

Post a Comment