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

Java Maven Artifact Migration #2205

Closed
davidgoate opened this issue Jan 3, 2019 · 6 comments
Closed

Java Maven Artifact Migration #2205

davidgoate opened this issue Jan 3, 2019 · 6 comments
Labels
F: dependency-deprecations Detecting, avoiding or removing deprecated versions F: language-support Issues specific to a particular language or ecosystem; may be paired with an L: label. L: java:maven Maven packages via Maven T: feature-request Requests for new features

Comments

@davidgoate
Copy link

When running my build, spotbugs appears to have suggested:

[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2

I'm not sure internally how spotbugs knows this, but I think it'd be awesome if dependabot were able to handle this type of PR. We were using:

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-io</artifactId>
    <version>1.3.2</version>
</dependency>

and now we can use instead

<dependency>
    <groupId>commons-io</groupId>
    <artifactId>commons-io</artifactId>
    <version>2.6</version>
</dependency>
@evenh
Copy link
Contributor

evenh commented Jan 7, 2019

This would be awesome!

@greysteil
Copy link
Contributor

Agreed - need to look into how spotbugs does that!

@bmuskalla
Copy link

bmuskalla commented Oct 7, 2019

Spotbugs and others can figure this out using the relocation metadata that maven artifacts can provide in their pom.xml. Example:

<distributionManagement>
    <relocation>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <message>https://issues.sonatype.org/browse/MVNCENTRAL-244</message>
    </relocation>
</distributionManagement>

See Maven documentation for more details. I started to dig a little into this but soon realized this might be bigger than expected. Not only would we need to fetch the latest dependency metadata (which isn't too bad but it does break a lot of the tests), the bigger issue I see is in actually rewriting the dependency coordinates. The maven UpdateChecker mostly deals with versions whereas we'd need to rewrite group_id and artifact_id of the maven dependency as well. This already challenges a lot of assumptions in the current version_finder (see bmuskalla/dependabot-core@7553704 for a rough approach; actually a lot of the existing code would better be refactored as it currently assumes the maven coordinates are stable).

@greysteil and @hmarr, any thoughts on whether this is worth the effort before I spent any more time on this? Or is there maybe a better way to introduce such a dependency rewrite?

@rebelagentm
Copy link
Contributor

@feelepxyz Thoughts on @bmuskalla's comment?

@feelepxyz
Copy link
Contributor

feelepxyz commented Oct 9, 2019

@rebelagentm @bmuskalla thanks for starting a fix for this! 🙇I think you're right, sounds like this will be a non-trivial change given our current architecture. Also haven't looked into how our maven setup works in detail but wondering if we could set the new group id and artifact id in requirement metadata for the updated dependencies and then read these out when updating, we already do something like this here:

if new_req.dig(:metadata, :property_name)

@infin8x infin8x transferred this issue from dependabot/feedback Jun 29, 2020
@infin8x infin8x added F: language-support Issues specific to a particular language or ecosystem; may be paired with an L: label. L: java:maven Maven packages via Maven T: feature-request Requests for new features labels Jul 2, 2020
@jeffwidman jeffwidman added the F: dependency-deprecations Detecting, avoiding or removing deprecated versions label Feb 11, 2023
@jeffwidman
Copy link
Member

@jeffwidman jeffwidman closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: dependency-deprecations Detecting, avoiding or removing deprecated versions F: language-support Issues specific to a particular language or ecosystem; may be paired with an L: label. L: java:maven Maven packages via Maven T: feature-request Requests for new features
Projects
None yet
Development

No branches or pull requests

8 participants