jakartaee / rest

Jakarta RESTful Web Services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

${packaging.type} variable in pom.xml breaks Ivy

glassfishrobot opened this issue · comments

The ${packaging.type} variable introduced in 71c20bd breaks Ivy with the following output:

:: problems summary ::
:::: WARNINGS
		[NOT FOUND  ] javax.ws.rs#javax.ws.rs-api;2.1!javax.ws.rs-api.${packaging.type} (491ms)

	==== public: tried

	  https://repo1.maven.org/maven2/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.${packaging.type}

		::::::::::::::::::::::::::::::::::::::::::::::

		::              FAILED DOWNLOADS            ::

		:: ^ see resolution messages for details  ^ ::

		::::::::::::::::::::::::::::::::::::::::::::::

		:: javax.ws.rs#javax.ws.rs-api;2.1!javax.ws.rs-api.${packaging.type}

		::::::::::::::::::::::::::::::::::::::::::::::

Judging by the todo comment in pom.xml you are aware of the issue, but perhaps you are not aware that, in its current state, this still breaks Ivy. It also breaks the download link on mvnrepository.com, by the way.

Here is the same issue in a different project with some interesting comments: ronmamo/reflections#169

I can resolve the issue manually by putting the jar files into my Ivy cache directory. As I'm using IntelliJ IDEA and the IvyIDEA plugin I can't use the system property fix mentioned in the link above (or can't figure out how). Maybe there is a better way to resolve this with Ivy, but I'm not sure as I'm quite new to it.

@ChristianCiach Commented
Duplicate of #571

@maltem-za Commented
@ChristianCiach Ah, thanks, I didn't find that one (obviously).

@maltem-za Commented
For anyone else who comes across this, you can fix it for Ivy by adding a filesystem resolver like this:

<filesystem name="mylocal">
  <ivy pattern= "${ivy.default.ivy.user.dir}/local/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]" />
  <artifact pattern= "${ivy.default.ivy.user.dir}/local/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]" />
</filesystem>

Then all you have to do is place the jar file in the configured location, for example:
~/ivy2/local/javax.ws.rs/javax.ws.rs-api/jars/javax.ws.rs-api-2.1.jar

Thanks to @mpetris for the solution.

@Randgalt Commented
This really needs to be fixed ASAP. It breaks sbt as well. I don't understand the need for <packaging>${packaging.type}</packaging> in the pom anyway. Why not just make it JAR?

@Randgalt Commented
Sad that you've closed this @pavelbucek - #571 does not fix the problem.

@nicktrav Commented
This is breaking things in the Pants build tool, which under the hood uses Ivy. I also don't understand why this issue was closed along with #571.

Seems like a trivial fix to just make this <packaging>jar</packaging>?

@nicktrav Commented
I'm very much in support. Left (non-passive-aggressive) my 👍 .

issue persists:

[ivy:resolve] tried /home/data/.ivy2/local/javax.ws.rs/javax.ws.rs-api/2.1/${packaging.type}s/javax.ws.rs-api.${packaging.type}
[ivy:resolve] tried http://repo1.maven.org/maven2/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.${packaging.type}
[ivy:resolve] CLIENT ERROR: Not Found url=http://repo1.maven.org/maven2/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.$%7Bpackaging.type%7D
[ivy:resolve] tried https://repository.apache.org/content/repositories/snapshots/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.${packaging.type}
[ivy:resolve] CLIENT ERROR: Not Found url=https://repository.apache.org/content/repositories/snapshots/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.$%7Bpackaging.type%7D
[ivy:resolve] tried http://oss.sonatype.org/content/repositories/releases/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.${packaging.type}
[ivy:resolve] WARN: [FAILED ] javax.ws.rs#javax.ws.rs-api;2.1!javax.ws.rs-api.${packaging.type}: (0ms)
[ivy:resolve] WARN: ==== local: tried
[ivy:resolve] WARN: /home/data/.ivy2/local/javax.ws.rs/javax.ws.rs-api/2.1/${packaging.type}s/javax.ws.rs-api.${packaging.type}
[ivy:resolve] WARN: ==== maven2: tried
[ivy:resolve] WARN: http://repo1.maven.org/maven2/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.${packaging.type}
[ivy:resolve] WARN: ==== apache-snapshot: tried
[ivy:resolve] WARN: https://repository.apache.org/content/repositories/snapshots/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.${packaging.type}
[ivy:resolve] WARN: ==== sonatype: tried
[ivy:resolve] WARN: http://oss.sonatype.org/content/repositories/releases/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.${packaging.type}

any workaround for this ?