I came across the following maven build issue while trying to use jboss.fuse.bom as dependency.
Non-resolvable import POM: Could not find artifact org.jboss.fuse.bom:jboss-fuse-parent:pom:6.1.0.redhat-399 in central (https://repo.maven.apache.org/maven2)
The dependacy
Dependency in pom.xml
<dependency>
<groupId>org.jboss.fuse.bom</groupId>
<artifactId>jboss-fuse-parent</artifactId>
<version>6.1.0.redhat-399</version>
<type>pom</type>
<scope>import</scope>
</dependency>
It is clear that, this dependency is not available in central repository. So, I defined jboss repository in the pom to resolve this issue, as shown below:
<repositories>
<repository>
<id>repo2</id>
<name>jboss repo</name>
<url>https://repository.jboss.org/nexus/content/groups/ea/</url>
</repository>
</repositories>
Now the build will use default repository(https://repo.maven.apache.org/maven2) and the newly defined jboss repository to resolve the dependencies.
Reference: Setting up multiple maven repositories
Related
When I run mvn package to compile a maven project it downloads the jar file from
wrong URLs. It adds org/dnosproject/ to the URL which is wrong.
Downloading: https://mvnrepository.com/artifact/io.github.dnos-project/dnos-lib-all/org/dnosproject/onos-port-protobuf/1.1.5/onos-port-protobuf-1.1.5.jar
<repositories>
<repository>
<id>dnos-lib-all</id>
<name>dnos-lib</name>
<url>https://mvnrepository.com/artifact/io.github.dnos-project/dnos-lib-all</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.github.dnos-project</groupId>
<artifactId>dnos-lib-all</artifactId>
<version>1.1.5</version>
</dependency>
The website mvnrepository.com is a kind of search engine across multiple real Maven repositories. If you look at the link you mentioned in your <repository/> configuration, you'll notice they list that dependency as available in "Central", in fact here. "Central" is configured by default, so you don't need a <repository/> configuration for this dependency. Instead, you just need the correct <dependency/> entry:
<dependency>
<groupId>io.github.dnos-project</groupId>
<artifactId>dnos-lib-all</artifactId>
<version>1.1.5</version>
</dependency>
You already had this in the snippet you posted, so just removing the <repository/> configuration should do the trick.
I'm trying to use spring-session-jdbc:2.0.0.RC2 which is not listed in https://mvnrepository.com/artifact/org.springframework.session/spring-session-jdbc/1.3.1.RELEASE
spring session github has newer version than mvnrepository.
How can I add the dependency of the new version in the pom.xml file?
To obtain dependencies that aren't on the central mvn repository, you must communicate to your project that you need it to point to an additional repository. In your case, this snippet, added to your pom, should do:
<repositories>
<repository>
<id>spring-milestone-repository</id>
<name></name>
<url>http://repo.spring.io/milestone/</url>
</repository>
</repositories>
After declaring this, you just add this to your dependencies, and it will be downloaded:
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-jdbc</artifactId>
<version>2.0.0.M2</version>
</dependency>
I am referencing a repository in my POM.xml to add the ojdbc.jar to my project but Maven (I use the STS plugin) keeps telling me it can't find the jar.
I am showing below my repositories and jar dependency as defined in my POM.xml.
Anyone has an idea as to why the jar can't be found? Is my POM.xml not setup properly?
Note the vaadin repo works fine as the vaadin jars are correctly added to my project.
<repositories>
<repository>
<id>myrepo</id>
<url>http://mvnrepository.com/</url>
</repository>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
and here is the dependency setup as defined at http://mvnrepository.com/artifact/ojdbc/ojdbc/14:
<dependencies>
<dependency>
<groupId>ojdbc</groupId>
<artifactId>ojdbc</artifactId>
<version>14</version>
</dependency>
</dependencies>
Anyone has an idea as to why the jar can't be found?
The jar can't be found due to license constraints.
Is my POM.xml not setup properly?
No it isn't, but adding to your pom the dependency:
<dependency>
<groupId>ojdbc</groupId>
<artifactId>ojdbc</artifactId>
<version>14</version>
</dependency>
you are able to download only the ojdbc14 pom because it has not a license limitation about distribution.
In order to make the above dependency works the jar has to be manually installed into your local Maven repository, without violating the license, by running:
mvn install:install-file -Dfile={Path_to_your_ojdbc.jar} -DgroupId=ojdbc
-DartifactId=ojdbc -Dversion=14 -Dpackaging=jar
eventually changing to the appropriate version number in -Dversion attribute, as correctly suggested by user1570577.
To use Oracle jdbc(OJDBC) driver with Maven, you can download the jar to your local machine and install it manually into your Maven local repository.
After downloading the jar install using the following command :
mvn install:install-file -Dfile={Path_to_your_ojdbc.jar} -DgroupId=com.oracle
-DartifactId=ojdbc -Dversion=14 -Dpackaging=jar . If the version is less than 14 change the appropriate version number in -Dversion attribute
Now you can set the dependency details in the pom file :
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc</artifactId>
<version>14</version>
</dependency>
</dependencies>
Oracle now has a maven repository: maven.oracle.com
See https://blogs.oracle.com/WebLogicServer/entry/weblogic_server_and_the_oracle
I am getting errors when I add sauce labs dependency in my pom xml.
<dependency>
<groupId>com.saucelabs</groupId>
<artifactId>sauce_testng</artifactId>
<version>1.0.19</version>
</dependency>
Is any one seeing the same issue?
The artifact is stored in the Sauce Labs Maven repository, can you add the following into your pom.xml file?
<repositories>
<repository>
<id>Sauce Maven Repository</id>
<url>https://repository-saucelabs.forge.cloudbees.com/release</url>
</repository>
</repositories>
The artifact that you are referring to is not in central. Are you sure that you have the info?
I have found this info
<dependency>
<groupId>com.saucelabs</groupId>
<artifactId>sauce-rest-api</artifactId>
<version>1.1</version>
I'm building a Java application which has a dependency on the Apache Airavata project. I can get it up and running by putting all dependency jar's on the classpath but I have problems setting up the project using Maven.
Problem seems to be some maven repositories are not available. I tried this a couple of months ago with the same result.
Update
I got an answer on the Airavata mailing list that they were aware of the problem, that they supposedly had fixed it and are planning to work away away the dependency. Still, the server does not seem to work:
http://markmail.org/search/+list:org.apache.airavata.users#query:%20list%3Aorg.apache.airavata.users+page:1+mid:y37nleni7hocoftg+state:results
Anyhow, I have now realized that I should use airavata-messenger-client, and that is possible to use with maven with the following dependencies:
<dependency>
<groupId>org.apache.airavata</groupId>
<artifactId>airavata-messenger-client</artifactId>
<version>0.5</version>
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
<artifactId>airavata-messenger-commons</artifactId>
<version>0.5</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-local</artifactId>
<version>1.6.2</version>
</dependency>
Error message
The container 'Maven Dependencies' references non existing library '[hidden]\.m2\repository\org\apache\airavata\airavata-message-broker\0.5\airavata-message-broker-0.5.jar'
[ERROR] [..] Failed to collect dependencies for [org.apache.airavata:airavata-message-broker:jar:0.5 (compile)]:
Failed to read artifact descriptor for xmlbeans:xbean:jar:2.5.0:
Could not transfer artifact xmlbeans:xbean:pom:2.5.0 from/to ogce.m2.all (http://community.ucs.indiana.edu:9090/archiva/repository/ogce.m2.all):
Connection to http://community.ucs.indiana.edu:9090 refused:
Connection refused: connect
pom.xml
<repositories>
<repository>
<id>repository.apache.org-public</id>
<name>Apache</name>
<url>http://repository.apache.org/content/groups/public</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.airavata</groupId>
<artifactId>airavata-message-broker</artifactId>
<version>0.5</version>
</dependency>
</dependencies>
Airavata has some third party jars pulled from a repo. Please copy paste the following two repos to your pom and see if the problem goes
<repository>
<id>central</id>
<name>Maven Central</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
<repository>
<name>ogce.m2.all</name>
<id>ogce.m2.all</id>
<url>http://community.ucs.indiana.edu:9090/archiva/repository/ogce.m2.all</url>
</repository>