Do I need to configure a repo to allow checking of snapshots?

help

#1

We have recently moved our internal repo from on server to another and upgraded it to 3.12.1-01 from 2.14.9-01.

Some apps are building fine but one has a problem…

It is a maven app and I has had a continual but unnoticed issue for some time

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

This has been unnoticed as much as anything becuase it has been ignored by maven and the build has continued successfully.

When I switch to look at the new repo though I get

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

[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]

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 (I appreciate the 2nd part of this may be beyond the scope of this forum…) ?


#2

I’m not sure I follow the question, but let me try and track down someone who might be able to help out on this.


#3

NXRM3 Maven has 3 version policies: Release, Snapshot, Mixed. I believe mixed will help you.
Alternatively if you have your snapshot and release repos in a group that should also work. That is how the default “maven-public” group is setup, for an actual example.


#4

You can tell Maven which repos contain releases or snapshots in the pom.xml or settings.xml configuration. See the examples here: Maven – POM Reference

However, I would recommend creating a group repository in your Nexus Repository Manager instance and updating your settings.xml “mirrorOf” settings to “*” as in Maven – Guide to Mirror Settings. Once Maven is downloading from a single location, you can fine tune the content of the group repository from Nexus rather than having to configure each of your maven projects’ pom.xml or each developers’ settings.xml.

You can read more about the benefits and use cases for group repositories here: Lesson 3: Creating and Managing Repository Groups