简体   繁体   中英

how to add my one project jar in another maven project in netbeans

I have one project jar oauth. I want to add it in another maven project . I tried to change pom.xml file but no effect. Can anyone please suggest me?

I tried to add following dependency in my pom.xml file:

<dependency>
  <groupId>com.payupaisa.oauth</groupId>
  <artifactId>auth</artifactId>
  <version>1.0.0</version>
  <type>jar</type>
  <scope>system</scope>
  <systemPath>${basedir}/src/main/webapps/WEB-INF/lib/auth.jar</systemPath>
</dependency>

With the assumption that you have that auth.jar in your local repository (as it builds fine).

Why don't you give a try like this.

<dependency>
  <groupId>com.payupaisa.oauth</groupId>
  <artifactId>auth</artifactId>
  <version>1.0.0</version>
  <scope>compile</scope>
</dependency>

Honestly speaking I don't prefer to give the jar location in my pom file and using scope as system, I leave this task to handle by Maven to resolve all the artifacts either by searching in local maven repository first(/.m2) or in MAVEN CENTRAL REPO if it is a 3rd party jar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM