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

BanDuplicateClasses trying to download artifacts #251

Open
delanym opened this issue Mar 7, 2023 · 4 comments
Open

BanDuplicateClasses trying to download artifacts #251

delanym opened this issue Mar 7, 2023 · 4 comments

Comments

@delanym
Copy link

delanym commented Mar 7, 2023

This rule seems to be very troublesome, but recently it became unbearable.

With this configuration

<banDuplicateClasses>
  <ignoreClasses/>
  <scopes/>
  <findAllDuplicates>false</findAllDuplicates>
  <ignoreWhenIdentical>false</ignoreWhenIdentical>
</banDuplicateClasses>

It tries to download an artifact already downloaded (why is it even downloading artifacts?) and outputs a whopping 25 lines for every missing dependency.

Downloading from maven-releases: https://nexus.segway.com/repository/maven-releases/com.segway.driver/java-modules/3.3.0/java-modules-3.3.0.pom
Downloaded from maven-releases: https://nexus.segway.com/repository/maven-releases/com.segway.driver/java-modules/3.3.0/java-modules-3.3.0.pom (425 B at 604 B/s)                                                                                                                                 
Downloading from maven-releases: https://nexus.segway.com/repository/maven-releases/com.segway.driver/java-modules/3.3.0/java-modules-3.3.0.jar
Downloaded from maven-releases: https://nexus.segway.com/repository/maven-releases/com.segway.driver/java-modules/3.3.0/java-modules-3.3.0.jar (7.3 MB at 2.2 MB/s)
[INFO] Building com.segway.msgfactories:segwaymsgfactory:1.2.16-SNAPSHOT
Downloading from pronto-public: https://nexus.segway.com/repository/maven-public/com.segway.driver/java-modules/3.3.0/java-modules-3.3.0.jar
[WARNING] Missing:
----------
1) com.segway.driver:java-modules:jar:3.3.0

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=com.segway.driver -DartifactId=java-modules -Dversion=3.3.0 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=com.segway.driver -DartifactId=java-modules -Dversion=3.3.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
        1) com.segway.driver:java-modules:jar:3.3.0

----------
1 required artifact is missing.

for artifact: 
  com.segway.driver:java-modules:jar:3.3.0

from the specified remote repositories:
  pronto-public (https://nexus.segway.com/repository/maven-public/, releases=true, snapshots=false)
Path to dependency: 
        1) com.segway.driver:java-modules:jar:3.3.0
@slawekjaranowski
Copy link
Member

Can you provide a simple project for reproduce?
Which version of extra rules and enforcer plugin do you use?

@delanym
Copy link
Author

delanym commented Mar 22, 2024

I updated to extra-enforcer-rules v1.8.0 but now the ban applies to third-party artifacts and not just the classes in my code. There are ignores, but it would be tedious to have to define all of them, so I'm just going to turn the rule off. Is this really such a bad situation?

09:55:33  Rule 7: org.codehaus.mojo.extraenforcer.dependencies.BanDuplicateClasses failed with message:
09:55:33  Duplicate class found:
09:55:33  
09:55:33    Found in:
09:55:33      jakarta.activation:jakarta.activation-api:jar:2.1.2:compile
09:55:33      org.glassfish.metro:webservices-api:jar:4.0.2:compile
09:55:33    Duplicate classes:
09:55:33      jakarta/activation/ActivationDataFlavor.class

Another example of being able to blacklist but not whitelist: https://issues.apache.org/jira/browse/MDEP-808

@slawekjaranowski
Copy link
Member

... interesting does version 1.7.0 don't check classes in external library ....? What is your code?

@delanym
Copy link
Author

delanym commented Mar 22, 2024

Unfortunately its not open source. It built with 1.7.0. I haven't changed dependencies since upgrading to 1.8.0

Does adding jakarta.activation-api and webservices-api to your project with v1.8.0 cause it to fail?

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

2 participants