I have 2 pom.xml files: the parent pom.xml file (called pomp.xml) and the default pom.xml file.
C:\pomp.xml:
<project ....>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>app</artifactId>
<version>test</version>
<packaging>pom</packaging>
<modules>
<module>my-app</module>
</modules>
</project>
C:\my-app\pom.xml
<project ...>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
If I run “mvn package -f pomp.xml” the above works. However, if I were to move pomp.xml to the same directory as pom.xml, it doesn’t work.
Is what I am trying to accomplish possible? if so, how?
I found a way to do it without modifying the child xml file. I just entered a ., to indicate the current directory, under module.