Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.1 maven integration issue #571

Closed
glassfishrobot opened this issue Sep 18, 2017 · 13 comments
Closed

2.1 maven integration issue #571

glassfishrobot opened this issue Sep 18, 2017 · 13 comments

Comments

@glassfishrobot
Copy link

I'm not sure if this is the right place to post this, but here goes.
I'm attempting to pull in jax-rs 2.1 in Gradle. Gradle complains that it can't resolve due to:
Could not HEAD 'http://central.maven.org/maven2/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.$%7Bpackaging.type%7D'

As you can see, the packaging .type variable is not getting resolved. I'm wondering if it's because the maven profile isn't getting set due to an incorrect value.

The [jax-rs 2.1 POM][1] defines the "jdk8-" profile as:

jdk8-

(,9)

..

I'm wondering if the (,9) is preventing any profile from getting picked up:
(,9)

According to the maven [range spec][2], should it be:
(,1.9)

@glassfishrobot
Copy link
Author

@ChristianCiach Commented
2.1 is a dependency for Jersey Core Server » 2.26, so we cannot use Jersey Server at the moment. Even the download button is broken: https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api/2.1

@glassfishrobot
Copy link
Author

@pavelbucek Commented
This seems like a gradle issue.

(we don't see that in maven and we are referencing jax-rs api in multiple places; I don't believe this is related to any profile declared in pom.xml).

@glassfishrobot
Copy link
Author

@ChristianCiach Commented
I am not convinced that it is a gradle issue.

I can't find anything about a magic variable called ${packaging.type} and there is no <properties>-block inside the pom file to declare any custom defined properties..

@glassfishrobot
Copy link
Author

@ChristianCiach Commented
I am sorry, I am wrong. There is a custom properties-block to declare this variable. I will ask the gradle guys for support.

@glassfishrobot
Copy link
Author

@ChristianCiach Commented
Gradle has very limited support for pom-profiles, which are discouraged to use anyway - so much so, that even mvnrepository.com can't generate a download link.

It would be nice if you at least could define a profile that is active by default:

<profile><activation><activeByDefault>true</activeByDefault></activation></profile>

Such a profile is picked up by gradle. You can still override these properties depending on the JDK-versions. Gradle will ignore these additional profiles.

Is this something you could do for us gradle users, please?

@glassfishrobot
Copy link
Author

@pavelbucek Commented
As stated in the email communication, we can't just do that. Released artifacts are immutable.

And since this is not a bug in JAX-RS deployment descriptor - the issue is in how gradle parses/uses pom files - I don't see this as a reason for 2.1.1 release.

@glassfishrobot
Copy link
Author

@crizo23 Commented
So where does responsibility lie for a pom.xml that doesn't play nice? Currently, Jersey/Swagger gradle users are negatively affected by this. Am I incorrect that these projects are the "customers" of jax-rs? Isn't jax-rs concerned with maximum adoption rate by making integration as easy as possible?

@glassfishrobot
Copy link
Author

@ibaca Commented
Uhm, using a maven property in the type seems pretty bad idea. Anyway, I just created a gradle project and added compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.1' and it works correctly so you should have some other problem.

@glassfishrobot
Copy link
Author

@ChristianCiach Commented

I just created a gradle project and added compile group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.1' and it works correctly

It does not work for me. What repository and gradle version are you using?

@glassfishrobot
Copy link
Author

@ibaca Commented
Version gradle-3.5-rc-2 and mavenCentral() (I just created a new gradle project on intellij). And after updating to the last version 4.2.1 it works too.

@glassfishrobot
Copy link
Author

@sslavic Commented
This broke sbt builds too, probably because sbt uses Apache Ivy just like Gradle.

In my case jax-rs api is a transitive dependency. As workaround tried ronmamo/reflections#169 (comment) and sbt/sbt#3618 (comment) but neither worked fully - with Ivy cache clean, initial build would fail. Only workaround that handles well clean local repo case was to explicitly add dependency to jax-rs api and defining jar artifact

libraryDependencies += "javax.ws.rs" % "javax.ws.rs-api" % "2.1" artifacts( Artifact("javax.ws.rs-api", "jar", "jar")), // this is a workaround for https://github.com/jax-rs/api/issues/571

@glassfishrobot
Copy link
Author

@maltem-za Commented
See my linked issue #572 for an Ivy fix

@glassfishrobot
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant