-2

I have a single Java Maven project having a pom.xml with jar packaging. Now I want to add a sub-project in that project. So, I need to change the packaging pom from jar.

<groupId>org.test.app</groupId>
<artifactId>testPom</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

Please provide any suggestion.

2
  • 3
    <packaging>pom</packaging> how else?
    – Stultuske
    Commented Sep 11, 2018 at 10:20
  • Are you aware of that nothing will be processed in src/[main|test]/... once you change the packaging type to pom, i.e. no <project>.jar will be created? Commented Sep 11, 2018 at 23:08

1 Answer 1

4

This would be the parent POM part with packaging and a couple of module references:

<groupId>org.test.app</groupId>
<artifactId>testPom</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>

<modules>
    <module>submodule</module>
    <module>another-submodule</module>
</modules>

Hope it helps.

Not the answer you're looking for? Browse other questions tagged or ask your own question.