I need to include a third party jar to my pom.xml (using Maven 3.2.5 on a Linux environment).
If the jar file is available on the same machine that runs the build I can just declare the dependency in this way:
<dependencies>
<dependency>
<groupId>Foo</groupId>
<artifactId>Foo</artifactId>
<version>Foo-1.0</version>
<scope>system</scope>
<systemPath>/myspace/javalibs/foo-1.0.jar</systemPath>
</dependency>
</dependencies>
But what if the jar is on a different server such as
<repositories>
<repository>
<id>myrepo</id>
<url>http://192.168.0.14/download/java/thirdparty_repo</url>
</repository>
</repositories>
In what element should I specify the name of the jar file?
Remove
<scope>system</scope>
<systemPath>/myspace/javalibs/foo-1.0.jar</systemPath>
from pom and Maven will find the jar in http://192.168.0.14/download/java/maven_repo automatically
Related
I am trying to add a dependency to my pom.xml and facing an issue: IntelliJ error
Cannot resolve jfugue:jfugue:5.0.9
The dependency I like to add is this one below from https://mvnrepository.com/artifact/jfugue/jfugue/5.0.9
<!-- https://mvnrepository.com/artifact/jfugue/jfugue -->
<dependency>
<groupId>jfugue</groupId>
<artifactId>jfugue</artifactId>
<version>5.0.9</version>
</dependency>
I have no problems adding other dependencies just by adding the xml-snippet from maven into my pom and refresh or reload all maven projects. For example I have this dependency in the same pom which is working fine:
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.14.3</version>
</dependency>
However, there is a note under the snippet which one can copy-paste, https://mvnrepository.com/artifact/jfugue/jfugue/5.0.9
Note: this artifact is located at SingGroup repository (https://maven.sing-group.org/repository/maven/)
What do I need to add to the pom so that I can use that dependency in my Project and get rid of the error?
Cannot resolve jfugue:jfugue:5.0.9
Thanks in advance.
You can add the repository to your settings.xml Maven Guide
<profiles>
<profile>
<id>multi-repo</id>
<repositories>
<repository>
<id>MavenCentral</id>
<url>https://repo.maven.apache.org/maven2/</url>
</repository>
<repository>
<id>MavenSing</id>
<url>https://maven.sing-group.org/repository/maven//</url>
</repository>
</repositories>
</profile>
</profiles>
This Lib is no longer on the Maven repo. I get same result when adding the dependency to my project's POM file. You can get the JAR file from this URL and then include it into your project's class path:
http://www.jfugue.org/download.html
I want to use a package named sourcemap in my project. It's not available in maven central, but in Atlassian's public maven repository. I therefore set up my pom.xml like this:
<repositories>
<repository>
<id>atlassian</id>
<name>Atlassian</name>
<url>https://packages.atlassian.com/content/repositories/atlassian-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.atlassian.sourcemap</groupId>
<artifactId>sourcemap</artifactId>
<version>1.7.7</version>
</dependency>
</dependencies>
Now, the POM file for sourcemap references another POM file from a package named public-pom:
<!-- POM for sourcemap (NOT my pom.xml!) -->
<parent>
<groupId>com.atlassian.pom</groupId>
<artifactId>public-pom</artifactId>
<version>3.0.84</version>
</parent>
The problem: the POM file references version 3.0.84 of public-pom, but Atlassian's repo no longer provides 3.0.84. Currently, the oldest available version of public-pom is 5.0.0, as you can see here. Because of this, maven complains when I attempt to build the project:
Could not find artifact com.atlassian.pom:public-pom:pom:3.0.84 in atlassian (https://packages.atlassian.com/content/repositories/atlassian-public/)
How can I fix the POM and use this package in my project?
Mvnrepository lists com.atlassian.pom:public-pom:pom:3.0.84 but when selecting the link to it:
status: 404
message: "Could not find resource"
I am using maven to add dependency. I added
<!-- https://mvnrepository.com/artifact/org.jboss.seam/jboss-seam -->
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<version>2.3.5.Final-redhat-1</version>
</dependency>
jboss-seam jar by using above lines in pom.xml. When I run mvn clean install it gives an error
What is the issue and how to solve this error?
Try adding the below repository in your pom file,
<repositories>
<repository>
<id>redhat</id>
<url>https://maven.repository.redhat.com/ga/</url>
</repository>
</repositories>
The artifact is not available in maven central repository. Its available only in redhat-ga repository.
I am trying to download the latest build of JFXtras (i want the .jar file) but i can't find it.
For 8.0-r6 i can see some .jar.soc .jar.asc what are those files? https://oss.sonatype.org/content/repositories/snapshots/org/jfxtras/jfxtras-all/
For 8.0-r5 a jar exists but it is empty it has only Meta-Inf http://central.maven.org/maven2/org/jfxtras/jfxtras-all/
How to download the jar or build it?And what are those other files there?I haven't seen them again that's why i am asking..
Problem Converting Project to Maven:
The .jar.asc files contain a PGP signature.
To make maven download the jar from maven central, add the dependency to pom.xml, e.g.
<dependencies>
<dependency>
<groupId>org.jfxtras</groupId>
<artifactId>jfxtras-all</artifactId>
<version>8.0-r5</version>
</dependency>
</dependencies>
Or grab the jars manually from http://central.maven.org/maven2/org/jfxtras/ and add them to your project.
If you want to use the bleeding edge snapshot (currently 8.0r6-SNAPSHOT), you'll need to add the sonatype repository to your pom like
<repositories>
<repository>
<id>snapshots-repo</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
And add the current snapshot to the dependencies, e.g.
<dependencies>
<dependency>
<groupId>org.jfxtras</groupId>
<artifactId>jfxtras-all</artifactId>
<version>8.0-r6-SNAPSHOT</version>
</dependency>
</dependencies>
But be aware that they're development versions (unstable), and their availability in that location can be temporary.
To download the -SNAPSHOT jars manually, you go to the sonata snapshot repository, choose the jfxtras package that you want to download, and scroll down to find the jar. They're simply not keeping all the older snapshots.
I have added two jar files to my internal repository and created its corresponding folder directory as shown below in image. but it is showing compile time error in my pom.xml where i have added the dependency for both the jars, saying "Missing artifact common:common-jar:jar:1.0" and "Missing artifact mediator:mediator-jar:jar:1.0"
look at my pom.xml below
<properties>
<jdk.version>1.7</jdk.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Maven plugin & MOJO versions -->
<version.maven-compiler-plugin>3.1</version.maven-compiler-plugin>
</properties>
<repositories>
<repository>
<id>in-project</id>
<name>In Project Repo</name>
<url>file://${basedir}/libs</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>common</groupId>
<artifactId>common-jar</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>mediator</groupId>
<artifactId>mediator-jar</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
please suggest what to do.
I think there is some problem identifying value for ${basedir} but i have also tried ${project.basedir} as well, it is also not working.
The problem lies in your url tag. Instead of <url>file://${basedir}/libs</url> try removing the double slash before ${basedir}: <url>file:${basedir}/libs</url>
You have a nice guide here if you want to check it.
First : Never use <scope>system</scope>
Follow the Example:
Project folder - C:\UX\X5SCX\GIT_STORE\SRC\FACTOR\fwk\broker\lib
<repositories>
<repository>
<id>local-repo</id>
<url>file://${basedir}/lib</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>ews</groupId>
<artifactId>ews-java-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>