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

japicmp-maven-plugin does no longer work with OSGI Bundles #280

Closed
rhierlmeier opened this issue Jan 21, 2021 · 6 comments
Closed

japicmp-maven-plugin does no longer work with OSGI Bundles #280

rhierlmeier opened this issue Jan 21, 2021 · 6 comments

Comments

@rhierlmeier
Copy link

rhierlmeier commented Jan 21, 2021

Since the fix of issue #278 (since version 0.15.1) the japicmp-maven-plugin can no longer be used for OSGI bundles.
I get the following exception:

[ERROR] Failed to retrieve comparison artifact: Failure to find 0000-999:STD_Web:bundle:2.2.2 in http://.../nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of DENexus has elapsed or updates are forced
org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find 0000-999:STD_Web:bundle:2.2.2 in http://.../nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of DENexus has elapsed or updates are forced
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:422)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:224)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:201)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact (DefaultRepositorySystem.java:260)
    at japicmp.maven.JApiCmpMojo.getComparisonArtifact (JApiCmpMojo.java:264)
    at japicmp.maven.JApiCmpMojo.populateArchivesListsFromParameters (JApiCmpMojo.java:320)
    at japicmp.maven.JApiCmpMojo.getOptions (JApiCmpMojo.java:440)
    at japicmp.maven.JApiCmpMojo.executeWithParameters (JApiCmpMojo.java:139)
    at japicmp.maven.JApiCmpMojo.execute (JApiCmpMojo.java:124)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)

The Maven project has packaging bundle:

<project ...>
	<artifactId>STD_Web</artifactId>
	<packaging>bundle</packaging>
@rhierlmeier
Copy link
Author

The problem has been introduced with commit a7d600b.
The change in line 252 is not correct.

@siom79
Copy link
Owner

siom79 commented Jan 23, 2021

I can reproduce the issue but changing line 252 of the commit does not solve the problem.

Interestingly the resolveVersionRange() call finds the bundle artifact version, but the subsequent resolveArtifact() call does not find it. But removing the extension from the resolveArtifact() call causes maven to not even find simple jar artifacts.

On the master branch I have added some small changes that map the bundle packaging to jar. I am not sure if this is correct, but in my case it resolved the issue. To be sure, I have asked a this question on stackoverflow.

siom79 added a commit that referenced this issue Jan 23, 2021
@rhierlmeier
Copy link
Author

I think you have to use MavenProject.getArtifact().getType() instead of MavenProject.getPackaging().
In addition you have to pass classier of to the constructor call.

@miKerscher
Copy link
Contributor

miKerscher commented Jul 19, 2021

The handling of the bundle artitacts was still not working. I made additional adjustments in PR #292.
It is working with this fix on my projects.

miKerscher added a commit to DEsoftware/japicmp that referenced this issue Jul 19, 2021
@miKerscher
Copy link
Contributor

Added two test bundles to PR #292.

siom79 added a commit that referenced this issue Oct 6, 2021
Issue #280: Fixed the packaging mapping from bundle to jar.
snuyanzin pushed a commit to snuyanzin/japicmp that referenced this issue Dec 3, 2021
snuyanzin pushed a commit to snuyanzin/japicmp that referenced this issue Dec 3, 2021
siom79 added a commit that referenced this issue Jan 29, 2022
…est bundle modules according to naming scheme, adjusted integration test to check for existing bundle report
@siom79
Copy link
Owner

siom79 commented Jan 29, 2022

Fixed: 0.15.5

@siom79 siom79 closed this as completed Jan 29, 2022
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

3 participants