I have never built my java applications by maven. But when i am trying to do that it's giving me error. I have created JAR file from other java application just by exporting as JAR from that application. Now i want to add this JAR in my maven application. I don't really how to do that.
this is how i have added in pom.xml. But i don't really know what should be it's artifact id. Seriously what is artifact id?
<dependency>
        <groupId>ProjectZen</groupId>
        <artifactId>community</artifactId>
        <scope>system</scope>
        <version>1</version>
        <systemPath>${basedir}\libs\ProjectZen.jar</systemPath>
    </dependency>
I am getting below error
Missing artifact ProjectZen:community:jar:1
Thanks Fahad Mullaji
Open the pom. xml file. under the project tag add <dependencies> as another tag, and google for the Maven dependencies.
The dependency is added to the consuming project's pom. xml file. Right-click pom. xml file of the consuming project, and select Run As>Maven Build.
If it is custom jar you need to do following things Open cmd and type following command
  mvn install:install-file  -Dfile=path-to-your-artifact-jar \
                      -DgroupId=ProjectZen
                      -DartifactId=community
                      -Dversion=1
                      -Dpackaging=jar
                      -DgeneratePom=true
Now, the “ProjectZen” jar is copied to your Maven local repository.
In pom.xml
  <dependency>
    <groupId>ProjectZen</groupId>
    <artifactId>community</artifactId>
    <scope>system</scope>
    <version>1</version>
    <systemPath>${basedir}\libs\ProjectZen.jar</systemPath>
</dependency>
now the “ProjectZen” jar is able to retrieve from your Maven local repository.
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