Maven Version range and Nexus 3.2 fails

498 views
Skip to first unread message

Henrik Lynggaard Hansen

unread,
Oct 17, 2017, 1:37:36 PM10/17/17
to Nexus Users
Hi

We are trying to build a Maven project that specifies its dependencies with maven ranges.

One of its dependencies is like this:
<dependency>
<groupId>com.oracle.servicebus</groupId>
<artifactId>client</artifactId>
<version>[12.1.3,12.1.4)</version>
<type>pom</type>
</dependency>

which as far as I can tell is a legal version range, however when the request hits nexus it fails with an internal server error

Caused by: java.net.URISyntaxException: Illegal character in path at index 30: /com/oracle/servicebus/client/[12.2.1,12.2.2)/client-[12.2.1,12.2.2).pom
at java.net.URI$Parser.fail(URI.java:2848) [na:1.8.0_112]
at java.net.URI$Parser.checkChars(URI.java:3021) [na:1.8.0_112]
at java.net.URI$Parser.parseHierarchical(URI.java:3105) [na:1.8.0_112]
at java.net.URI$Parser.parse(URI.java:3063) [na:1.8.0_112]
at java.net.URI.<init>(URI.java:588) [na:1.8.0_112]
at java.net.URI.create(URI.java:850) [na:1.8.0_112]

This is despite the URL being requested has URL encoded [ to %5B

I am not sure if this is a bug in Maven, Nexus or the pom.xml as I don't know which part actually does the resolving of version range

Can someone help with clues

Best regards
Henrik Lynggaard

Peter Lynch

unread,
Oct 17, 2017, 3:41:56 PM10/17/17
to Henrik Lynggaard Hansen, Nexus Users
This is more likely a Maven plugin problem not written to expect version ranges. In order to tell you would need to give someone the entire error message that maven fails with. I suggest posting your question with more detail on the Apache Maven users list or the plugin authors issue tracker.

A Maven version that supports versions ranges will not send a remote request to a remote server that includes a version range in the URL - therefore this can't be a Nexus problem.



--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/CALPiMPVubznpX7t0dzHN81SYFkZtYXraMM8U6s7tGVZH5%2B9BRw%40mail.gmail.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.

Henrik Lynggaard Hansen

unread,
Oct 17, 2017, 7:29:16 PM10/17/17
to Peter Lynch, Nexus Users
Hi

I thought something as central as version resolution and range handling was central to maven, sounds a bit strange that the individual plugin needs to handle that?


I don't have the error message right at this moment, but I can tell you that it tries to download the URL:

which results in a 500 Internal server error.

Doing the same in a browser gives:
"javax.servlet.ServletException: java.lang.IllegalArgumentException: Illegal character in path at index 30: /com/oracle/servicebus/client/[12.2.1,12.2.2)/client-[12.2.1,12.2.2).pom"


The thing we are trying to do is run dependency:go-offline in order to ensure all dependencies are available locally ref:https://maven.apache.org/plugins/maven-dependency-plugin/go-offline-mojo.html

I would have assumed this to be a fairly core plugin and certainly for it to understand ranges but then again I would expect that to be core maven

Best regards
Henrik

Rich Seddon

unread,
Oct 17, 2017, 7:59:15 PM10/17/17
to Nexus Users, ply...@sonatype.com
Maven doesn't send the version range over to a remote repository.  That's a violation of the maven repository protocol.  The problem is in your build, it should be resolving the version range by downloading the appropriate maven-metadata.xml files, and then requesting a specific version from Nexus.

This is not a problem in Nexus.

Regards,

Rich


On Tuesday, October 17, 2017 at 6:29:16 PM UTC-5, Henrik Lynggaard Hansen wrote:
Hi

I thought something as central as version resolution and range handling was central to maven, sounds a bit strange that the individual plugin needs to handle that?


I don't have the error message right at this moment, but I can tell you that it tries to download the URL:

which results in a 500 Internal server error.

Doing the same in a browser gives:
"javax.servlet.ServletException: java.lang.IllegalArgumentException: Illegal character in path at index 30: /com/oracle/servicebus/client/[12.2.1,12.2.2)/client-[12.2.1,12.2.2).pom"


The thing we are trying to do is run dependency:go-offline in order to ensure all dependencies are available locally ref:https://maven.apache.org/plugins/maven-dependency-plugin/go-offline-mojo.html

I would have assumed this to be a fairly core plugin and certainly for it to understand ranges but then again I would expect that to be core maven

Best regards
Henrik


Brian Fox

unread,
Oct 17, 2017, 8:05:34 PM10/17/17
to Rich Seddon, Nexus Users, Peter Lynch
What Rich said..

The maven-metadata.xml files list out the versions of the dependency at hand and then maven will pick a version using an algorithm and then make a request to the repo. Maven was originally built to work against just a dumb http file system so no resolution remotely is done. It's possible that it can't find the maven-metadata.xml file or some other weird bug is causing the resolution to fail to pick a version. I can't ever recall seeing this.

Reply all
Reply to author
Forward
0 new messages