I have two Maven projects. One should be a dependency to another. Both have pom.xml files. When I search repository, it sees the local project and automatically added.
The pom.xml entry when I add it:
<dependencies>
<dependency> // for another dependency, an external jar
<groupId>..</groupId>
<artifactId>..</artifactId>
<version>...</version>
</dependency>
<dependency> // the one for other project which I want to add as dependency
<groupId>..</groupId>
<artifactId>..</artifactId>
<version>..</version>
</dependency>
</dependencies>
But the references to that project can not see the classes. Is there some specific way to do that, instead of adding from repository?
You set the type of dependency using the <type>
tag inside <dependency>
tag.
<dependency>
<groupId>..</groupId>
<artifactId>..</artifactId>
<version>...</version>
<type>jar OR war OR ejb-client OR test-jar</type>
</dependency>
The default value for type is jar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With