1

I have my project structure like this.

 pro pro-common pom.xml pro-list-history ==> [1] Packaging type pom pro-list-main pro-list-entities pom.xml pro-list-daos pom.xml pro-list-services pom.xml pom.xml pro-search pom.xml pro-customers pom.xml pom.xml pro2 pro-list-history pro-list-main pro-list-entities pom.xml pro-list-daos pom.xml pro-list-services pom.xml ==> Want to use [1] pom.xml pom.xml 

My question is is okay to use groupId and artifactID from [1] in the second project as shown above? The referred module packaging type is pom.

Put a dependency section in the project two at the specified module as shown above, and specified as pom. Build is fine, but its not importing the dependencies from that project.

Can anyone help?

4
  • What are you actually trying to accomplish? Use one library in another project? Have a common parent pom? Commented Jun 6, 2013 at 4:12
  • Question is adding a reference to a POM package module as a dependency in a project. Yes, I need to include libraries from the other pojrect, which has parent packageed as pom. Commented Jun 6, 2013 at 19:48
  • You will need to run mvn install and/or mvn deploy project 1 so that you can use its libraries in project 2. Commented Jun 6, 2013 at 19:52
  • I did that. But since the other project I am referring to is a pom type, its not including the dependencies. Commented Jun 6, 2013 at 20:02

2 Answers 2

1

First, you can depend on a POM dependency. See: Netbeans: maven dependencies of type pom for an example and discussion.

However, I think you are asking if there is a short-hand way to import all the sub-modules of a "parent" module by specifying its pom.If so, see this question: Maven - include all submodules of a pom as dependencies in another module

Sign up to request clarification or add additional context in comments.

Comments

1

You can just reference the sub-module in another module like you would a file:

<modules> <module>inside-project-module</module> <module>inside-project-module</module> <module>inside-project-module</module> <module>../OtherProject/outside-project-module</module> <modules> 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.