GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [MSHADE-364] drop duplicates handled by a transformer by rmannibucau · Pull Request #48 · apache/maven-shade-plugin

Conversation

@rmannibucau

@rmannibucau rmannibucau commented May 12, 2020

Copy link
Copy Markdown
Contributor

When a transformer handles a resource then the resource being duplicated is ok since the transformer will merge it so no need to log it (in particular as a warning).


Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [MSHADE-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace MSHADE-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its clean verify).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
elharo
elharo reviewed May 12, 2020
View reviewed changes
Comment thread src/main/java/org/apache/maven/plugins/shade/DefaultShader.java
}
else
{
duplicates.remove( name, jar );

@elharo elharo May 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could there be a test for this?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rmannibucau rmannibucau May 12, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added https://github.com/apache/maven-shade-plugin/pull/48/files#diff-bc8729c3b7ec6843be39d656cb9b2d40R96

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rmannibucau
rmannibucau force-pushed the MSHADE-364 branch from 09d6560 to 6a8986d Compare May 12, 2020 12:54
elharo
elharo reviewed May 12, 2020
View reviewed changes
Comment thread src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java Outdated
}

public void testOverlappingResourcesAreLoggedExceptATransformerHandlesIt() throws Exception {
final TemporaryFolder temporaryFolder = new TemporaryFolder();

@elharo elharo May 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO not necessary to mark local variables final

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rmannibucau rmannibucau May 12, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java Outdated
}

@Override
public void debug( final String s, final Throwable throwable )

@elharo elharo May 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need to mark arguments final

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rmannibucau rmannibucau May 12, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java Outdated
private final List<String> debugMessages = new ArrayList<>();
private final List<String> warnMessages = new ArrayList<>();

public MockLogger()

@elharo elharo May 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't need to be public as it's in a private class

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rmannibucau rmannibucau May 12, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java

temporaryFolder.delete();

assertTrue(logWithTransformer.warnMessages.toString(), logWithTransformer.warnMessages.isEmpty());

@elharo elharo May 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the purpose of this PR to add another warning to the log?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rmannibucau rmannibucau May 12, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to remove it

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/test/java/org/apache/maven/plugins/shade/DefaultShaderTest.java Outdated

assertTrue(logWithTransformer.warnMessages.toString(), logWithTransformer.warnMessages.isEmpty());
assertTrue(logWithoutTransformer.warnMessages.toString(), logWithoutTransformer.warnMessages.containsAll(
Arrays.<String>asList( "j1.jar, j2.jar define 1 overlapping resources:", "- foo.txt" ) ) );

@elharo elharo May 12, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resources --> resource when it's singular

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rmannibucau rmannibucau May 12, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@asfgit
asfgit force-pushed the MSHADE-364 branch from 035ed39 to e2ddd07 Compare May 13, 2020 00:54
@rmannibucau

rmannibucau commented May 13, 2020

Copy link
Copy Markdown
Contributor Author

CI is blue/green, any blocker to merge?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

michael-o
michael-o requested changes May 13, 2020
View reviewed changes
Comment thread src/main/java/org/apache/maven/plugins/shade/DefaultShader.java Outdated
overlaps.add( "classes" );
if ( resources.size() == 1 )
{
overlaps.add( "classe" );

@michael-o michael-o May 13, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant e?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rmannibucau rmannibucau May 13, 2020

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say french typo ;). Thanks for the catch, should be fixed now

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@michael-o michael-o May 13, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed so...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rmannibucau
rmannibucau force-pushed the MSHADE-364 branch from e2ddd07 to d79c689 Compare May 13, 2020 12:38
@rmannibucau
[MSHADE-364] drop duplicate resource warning when the resource is han…
34736cc
…dled by a transformer
@rmannibucau
rmannibucau force-pushed the MSHADE-364 branch from d79c689 to 34736cc Compare May 13, 2020 17:20
@rmannibucau
rmannibucau merged commit 3691f60 into master May 14, 2020
@rmannibucau
rmannibucau deleted the MSHADE-364 branch May 14, 2020 07:04
@sos-jira-migration-bot sos-jira-migration-bot Bot mentioned this pull request May 14, 2020
[MSHADE-364] Don't log as duplicate resource handled by a transformer support-and-care/mvn-mshade-issues-migration-test#110
Closed
@jira-importer

jira-importer commented Jun 14, 2025

Copy link
Copy Markdown

Resolve #568

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

1 similar comment
@jira-importer

jira-importer commented Jun 14, 2025

Copy link
Copy Markdown

Resolve #568

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@michael-o michael-o michael-o requested changes
@elharo elharo elharo left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@rmannibucau @jira-importer @michael-o @elharo
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.