Apache Airavata dependency in Maven - maven

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>

Related

How can I use Maven locations in Eclipse Target files that come from custom repositories

I am trying to use a maven location in a Tycho build, that comes from a different repository than maven central. Below is the part of the definition that provides this on PDE. Tycho does not seem to honour the repository declaration and fails on resolution. Assuming I am observing this correctly, I have the following
Question: How can I hint Tycho to understand that these maven coordinates should be obtained from the associated repositories?
If this is not a current feature, but there is an issue, please comment as well, so this can be found and tracked.
<location includeDependencyScope="compile" includeSource="true" missingManifest="generate" type="Maven">
<dependencies>
<dependency>
<groupId>com.github.amlorg</groupId>
<artifactId>amf-api-contract_2.12</artifactId>
<version>5.0.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.raml</groupId>
<artifactId>webapi-parser</artifactId>
<version>0.5.0</version>
<type>jar</type>
</dependency>
</dependencies>
<repositories>
<repository>
<id>mulesoft.releases</id>
<url>https://repository-master.mulesoft.org/nexus/content/repositories/releases</url>
</repository>
<repository>
<id>mulesoft.public</id>
<url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
</repository>
</repositories>
</location>

mvn- look for wrong url in maven repositories

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.

Repository Version Policy : ignore missing poms?

Having looked at this some more I realise
The thing that confuses me is that maven is searching the repo for this file and not finding it. I don’t understand why a different local repo (one of 6 listed repos in the POM file) should be a problem.
My assumption is that the problem comes in the Version Policy of the repository being Release. This is surely what the error implies but the old repository also had a policy of release and anyway I’m not storing the snapshot on there is is only looking for it as it is the dependency of a dependency stored on Maven Central that isn’t found.
Is there a way I can either change the policy to allow it to be searched for snapshots or stop maven from searching this repo for snapshots ?
We have moved our internal repo from on server to another and upgraded it to 3.12.1-01 from 2.14.9-01.
We have migrated the artifacts over using the agent. I have built a couple of simple projects using the new repo and all seems well.
However on one app I am getting this error
[INFO] ------------------------------------------------------------------------
Downloading: http://reposerver:8081/repository/releases/org/glassfish/javax.el/3.0.1-b06-SNAPSHOT/javax.el-3.0.1-b06-SNAPSHOT.pom
Downloading: http://reposerver:8081/repository/releases/org/glassfish/javax.el/3.0.1-b07-SNAPSHOT/javax.el-3.0.1-b07-SNAPSHOT.pom
Downloading: http://reposerver:8081/repository/releases/org/glassfish/javax.el/3.0.1-b08-SNAPSHOT/javax.el-3.0.1-b08-SNAPSHOT.pom
...
[INFO] -----------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project :
Could not resolve dependencies for project :
Failed to collect dependencies at org.eclipse.jetty:jetty-
jsp:jar:9.2.19.v20160908 -> org.glassfish.web:javax.servlet.jsp:jar:2.3.2 ->
org.glassfish:javax.el:jar:3.0.1-b06-SNAPSHOT:
Failed to read artifact descriptor for org.glassfish:javax.el:jar:3.0.1-b06-SNAPSHOT:
Could not transfer artifact org.glassfish:javax.el:pom:3.0.1-b06-SNAPSHOT from/to releases.new
(http://reposerver:8081/repository/releases/): Failed to transfer file:
http://reposerver:8081/repository/releases/org/glassfish/javax.el/3.0.1-b06-SNAPSHOT/javax.el-3.0.1-b06-SNAPSHOT.pom.
Return code is: 400 , ReasonPhrase:Repository version policy: RELEASE does
not allow version: 3.0.1-b06-SNAPSHOT. -> [Help 1]
If I point back to the old repo I don't have a problem at all. I had a quick go trying to change jetty versions and exclude javax.el to just avoid using the snapshot dependency and get the project to build but I can't seem to easily do this without causing catastrophic build failures.
Checking again I have missed this ongoing warning when using the old repositorty
[WARNING] The POM for org.glassfish:javax.el:jar:3.0.1-b06-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.glassfish:javax.el:jar:3.0.1-b07-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.glassfish:javax.el:jar:3.0.1-b08-SNAPSHOT is missing, no dependency information available
I have tried adding this repo which seems to have the snapshot
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
</repository>
but this makes no difference.
As I understand it maven is trying all repos to recursively find all dependencies and as my local repo is last it is reporting the error after checking my local repo. The error about snapshot policies is a false message and the issue is it can't find the POM for the javax-el jar and so can't continue looking for dependencies. I don't understand why it iognores after looking at one repo and fails when it is instructed to look at another ?
The only difference between success an failure at my end is
Success:
<repository>
<id>releases</id>
<name>App Repository</name>
<url>http://oldserver:8081/repository/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>snapshots</id>
<name>App Repository</name>
<url>http://newserver:8081/repository/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
FAILURE
<repository>
<id>releases</id>
<name>App Repository</name>
<url>http://newserver:8081/repository/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>snapshots</id>
<name>App Repository</name>
<url>http://newserver:8081/repository/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
Is this a setting on the new nexus repository ? At the moment I'm hoping for a simple like for like fix but if you think I need to change the dependencies I'm calling then that's fine
Jetty dependencies called
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>9.0.6.v20130930</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>apache-jstl</artifactId>
<version>9.2.19.v20160908</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jsp</artifactId>
<version>9.2.19.v20160908</version>
</dependency>
Okay I haven't found an answer for why the versions of Nexus seem to act differently (this my be my misunderstanding of the root cause!)
I have fixed it with a simple pom mod (which I thought I had tried before but I must have gone round in some silly circles)
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jsp</artifactId>
<version>9.2.19.v20160908</version>
<exclusions>
<exclusion>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish/javax.el -->
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>3.0.0</version>
</dependency>

Non-Resolvable dependency issue while using jboss.fuse.bom

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

Error in pom.xml when adding sauce labs dependencies

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>

Resources