0

I have two child modules, A and Util. And I have added the dependency in the pom file of A likes:

 <dependency>
    <groupId>xxx</groupId>
    <artifactId>Util</artifactId>
    <version>0.0.1-SNAPSHOT</version>
 </dependency>

With this, I can use the class of Util in module A.

But when I want to generate the jar of A, there is an error of

xxx does not exit where xxx es the class of module Util.

I want to know how I can generate the .jar

Update:

The error information is: enter image description here

And After I added the dependency, there is not the .jar in the Maven dependencies, it is a file "Util": enter image description here

The Util module is : enter image description here

I also used "maven install" in Util and the result is:

enter image description here

The command I used to generate is "mvn clean package -DskipTests=true"

gloria
  • 51
  • 1
  • 9
  • I assume there are errors within your error message - please correct it so that we don't have to estimate what error message you are reffering to. Besides this - what do you mean with "generate"? Do you mean generating a jar by executing `mvn package`? Is `Util` in your maven repository / did you execute `mvn install` in your Util project? – Niklas P Oct 04 '17 at 12:32
  • @NiklasP I have updated mu question – gloria Oct 04 '17 at 13:38

2 Answers2

0

I was also facing same issue. What I did this:

Just right click on maven dependencies of project A > select properties > click on use maven project settings > uncheck Resolve dependencies from Workspace projects

Eclipse displays that when the dependency is found in the same workspace. You can disable this in maven or project settings, then you'd need to build using mvn to see your dependency jar listed like other.

Ahmed
  • 77
  • 5
Ramesh Kumar
  • 1,508
  • 15
  • 16
-1

I have solved it!

the dependency should be:

<dependency>
  <groupId>AWSTest</groupId>
  <artifactId>AWSUtil</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <type>test-jar</type>
            </dependency>
gloria
  • 51
  • 1
  • 9