Hi all, I have parent web module called "PARENT". And I have another web module called "CHILD". PARENT module's packaging is war. How can I add a dependency in CHILD module. I have tried the following. But it doesn't works.
Root 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">
<modelVersion>4.0.0</modelVersion>
<groupId>MY_App</groupId>
<artifactId>MY_App</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>MY Application</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>ibiblio</id>
<name>iBiblio Maven2 Repository</name>
<url>http://www.ibiblio.org/maven2</url>
</repository>
<repository>
<id>apache-repo</id>
<name>Apache Repository</name>
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
</repository>
</repositories>
<modules>
<module>MY_PARENT</module>
<module>MY_CHILD</module>
</modules>
</project>
PARENT web module 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 ">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>MY_App</artifactId>
<groupId>MY_App</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>MY_App</groupId>
<artifactId>MY_PARENT</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>MY_PARENT Webapp</name>
<url>http://maven.apache.org</url>
</project>
CHILD web module 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 ">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>MY_App</artifactId>
<groupId>MY_App</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>MY_App</groupId>
<artifactId>MY_CHILD</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>MY_CHILD Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>MY_App</groupId>
<artifactId>MY_PARENT</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
</project>
While packaging the application I am getting compilation error. ie, CHILD module doesn't refers the classes of PARENT module.
Note: I have removed "http://maven.apache.org/maven-v4_0_0.xsd" this schema location because of the limitation.