Repository Version Policy : ignore missing poms? - maven

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>

Related

Could not find artifact com.wavefront:wavefront-spring-boot-bom:pom:2.1.1-SNAPSHOT

I am using spring-cloud-sleuth-otel-autoconfigure dependency for distributed tracing. Getting error while mvn clean install -X
Actual error message is Could not find artifact com.wavefront:wavefront-spring-boot-bom:pom:2.1.1-SNAPSHOT in xxxxSnapshots i am using settings.xml file in inside .m2 folder.
i tried to exclude these wavefront-spring-boot-bom dependency. but iam not able to see the mvn dependency:tree bcs of build failure. This is the repo link..https://repo.grails.org/grails/core/org/springframework/cloud/spring-cloud-sleuth-otel-dependencies/1.0.0-M7/
and this is excactly what i added.
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-otel-autoconfigure</artifactId>
<version>1.0.0-M7</version>
<exclusions>
<exclusion>
<groupId>com.wavefront</groupId>
<artifactId>wavefront-spring-boot-bom</artifactId>
</exclusion>
</exclusions>
</dependency>
<repositories>
<repository>
<id>grails</id>
<name>grails</name>
<url>https://repo.grails.org/grails/core/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>grails-plugins</id>
<name>grails-plugins</name>
<url>https://repo.grails.org/grails/plugins</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
How can i fix this issue?
Could you please try the followings:
Go to https://start.spring.io and generate a project with sleuth
Follow the documentation and add Sleuth-OTel (exclude Brave)
Please use the official repo (see the docs above) instead of third -party ones
Two extra tips:
Use mvn verify instead of mvn clean install
OTel is still in Alpha, it is not meant to be used in production (that's why SLeuth-OTel is an incubator project)

maven.elasticsearch.org returning a 404

We are running into an issue with our Maven dependency on the Elastic Search Libraries that our code depends on in order to build / compile.
The build process fetched these libraries at build time, however the maven elastic search repository seems to be off line all together.
http://maven.elasticsearch.org/ currently returns a 404 resulting in everything below it being unavailable which results in the build process failing.
Even the maven central repo for elastic shield returns 404's https://repo.maven.apache.org/maven2/org/elasticsearch/plugin/shield/
I have sent an email to support#elastic.co asking them to turn the Elastic Repo back on, any other idea why this repo would just go offline and how would I go about rectifying it? A local onsite mirror of central, but it feels like overkill for what we need it for.
From the official document here
The repository URL is : https://artifacts.elastic.co/maven/org/elasticsearch/plugin/shield/2.4.6/shield-2.4.6.jar
If you are using maven:
<project ...>
<repositories>
<!-- add the elasticsearch repo -->
<repository>
<id>elasticsearch-releases</id>
<url>https://artifacts.elastic.co/maven</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
...
</repositories>
...
<dependencies>
<!-- add the shield jar as a dependency -->
<dependency>
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>shield</artifactId>
<version>2.4.6</version>
</dependency>
...
</dependencies>
...
</project>

Maven versioning issue, mvn3 looks into maven2 repo

I am explicetely run maven 3 to build my project:
sudo /usr/share/maven3/apache-maven-3.3.9/bin/mvn clean install
I received error like this:
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Failure to find org.jboss.bom:jboss-javaee-6.0-with-tools:pom:1.0.4.Final-redhat-9 in https://repo.maven.apache.org/maven2 was cached in the local repository
...
I don't want to delete my maven2 it exist separately.
Question: What have I forgotten to get done to get maven3 work w/o errors?
There is no conflict between Maven 3 and Maven 2, https://repo.maven.apache.org/maven2 is default repository in Maven 3, even though its name and suffix may be misleading, mentioning the ending 2, but most probably kept for backward compatibility.
The default repository for Maven 3 is per official documentation:
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
The same applies to the local cache, .m2 folder, again, it is the default for Maven 3 as well.
<localRepository>${user.home}/.m2/repository</localRepository>
Your issue hence is not related to conflict between Maven versions, but due to wrong coordinates of the concerned dependency.
The existing related one is:
<dependency>
<groupId>org.jboss.bom</groupId>
<artifactId>jboss-javaee-6.0-with-tools</artifactId>
<version>1.0.4.Final</version>
<type>pom</type>
</dependency>
But you specified an additional classifier: redhat-9, which is not available in Maven central repository, hence the error.

Maven 3 ignores defined Remote Repository and fails to download snapshot artifact

I am attempting to use a snapshot version of a Groovy compiler from codehaus snapshot repository as specified here -but cannot seem to make maven see the artifact in the repository.
I have the following plugin configuration:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<!-- 2.8.0-01 and later require maven-compiler-plugin 3.1 or higher -->
<version>3.1</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
<!-- set verbose to be true if you want lots of uninteresting messages -->
<!-- <verbose>true</verbose> -->
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.9.0-01-SNAPSHOT</version>
</dependency>
<!-- for 2.8.0-01 and later you must have an explicit dependency on groovy-eclipse-batch -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.2.1-01-SNAPSHOT</version>
<!-- or choose a different compiler version -->
<!-- <version>1.8.6-01</version> -->
<!-- <version>1.7.10-06</version> -->
</dependency>
</dependencies>
</plugin>
<plugin>
And my repositories section shows the following information:
<repository>
<id>Nexus Codehaus</id>
<url>http://nexus.codehaus.org/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
However, when I run mvn -U clean install I get the following message:
[WARNING] The POM for org.codehaus.groovy:groovy-eclipse-compiler:jar:2.9.0-01-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.codehaus.groovy:groovy-eclipse-batch:jar:2.2.1-01-SNAPSHOT is missing, no dependency information available
I also see the following when building the modules
Downloading: http://repository.apache.org/snapshots/org/codehaus/groovy/groovy-eclipse-compiler/2.9.0-01-SNAPSHOT/maven-metadata.xml
Downloading: http://repository.apache.org/snapshots/org/codehaus/groovy/groovy-eclipse-compiler/2.9.0-01-SNAPSHOT/groovy-eclipse-compiler-2.9.0-01-SNAPSHOT.pom
[WARNING] The POM for org.codehaus.groovy:groovy-eclipse-compiler:jar:2.9.0-01-SNAPSHOT is missing, no dependency information available
Downloading: http://repository.apache.org/snapshots/org/codehaus/groovy/groovy-eclipse-batch/2.2.1-01-SNAPSHOT/maven-metadata.xml
Downloading: http://repository.apache.org/snapshots/org/codehaus/groovy/groovy-eclipse-batch/2.2.1-01-SNAPSHOT/groovy-eclipse-batch-2.2.1-01-SNAPSHOT.pom
[WARNING] The POM for org.codehaus.groovy:groovy-eclipse-batch:jar:2.2.1-01-SNAPSHOT is missing, no dependency information available
Downloading: http://repository.apache.org/snapshots/org/codehaus/groovy/groovy-eclipse-compiler/2.9.0-01-SNAPSHOT/groovy-eclipse-compiler-2.9.0-01-SNAPSHOT.jar
Downloading: http://repository.apache.org/snapshots/org/codehaus/groovy/groovy-eclipse-batch/2.2.1-01-SNAPSHOT/groovy-eclipse-batch-2.2.1-01-SNAPSHOT.jar
It appears maven is trying to download the artifacts from a repository that I have not even defined! Why would this occur?
If I browse the repository I can see a POM as well as the various snapshot jars, so I can see no reason why this would not work. Am I missing something in my repository declaration?
Apparently when you want to download a maven plugin from a remote repository -as opposed to a standard artifcat, you have to define a special pluginRepositories section in your pom; a plain Repository declaration will just be ignored.
<pluginRepositories>
<pluginRepository>
<id>Nexus Codehaus</id>
<url>http://nexus.codehaus.org/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

Apache Airavata dependency in 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>

Resources