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

Change names of files with the same path - this time by Transformer #102

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

amorfis
Copy link

@amorfis amorfis commented Oct 14, 2014

Hello,

What about this one? ;)

@amorfis
Copy link
Author

amorfis commented Nov 4, 2014

Hello,
As you proposed, I moved the file renaming functionality to the Transformer. Could you check it, and maybe merge?

}
}
} else {
transform(archiveFile, archive)
transform(mergedJarFile.name, archiveFile, mergedJar)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Won't mergedJar.name work fine for this? Seems like we've made a bunch of changes that aren't really need as the information is available from the existing API.

Copy link
Collaborator

Choose a reason for hiding this comment

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

On that note, I'd prefer if you kept the changes to a minimum. The variable renames makes this a lot harder to review because it's harder to see what the actually change was.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, thanks for looking at this! WRT variables naming, I was really lost with "archive", it was never clear to me if it is the .jar we are merging into fat jar, or far jar itself.
WRT redundancy, I'll look at this, but AFAIR there was no jar file path in mergedJar

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd prefer to name the variable sourceJar then.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or sourceArchive

@ugoscaiella
Copy link

Hi,
What's the status of this PR?

I was trying to restore the possibility to filter-out files from certain jars, a feature that was supported in the past (according to the old readme, but I never tested it):

shadow {
    filter('org.apache.maven.its.shade.fac:a') {
        include '**/a.properties'
    }
    filter('org.apache.maven.its.shade.fac:b:client') {
        exclude 'org/apache/*'
        exclude 'org/apache/maven/b/'
    }
    filter('*:*') {
        exclude 'org/*'
    }
}

I tried to implement this using a Transformer, but I think that this PR is required, because the transformer API does not have any information about the path or the name of the jar which the file comes from...
is it right?

codefromthecrypt pushed a commit to openzipkin/zipkin that referenced this pull request Jan 4, 2016
The shadowJar plugin makes a single file out of all the dependencies of
our services. Occasionally, this leads to file conflicts.

Jackson's META-INF/LICENSE conflicts with the directory META-INF/license

While we can run the shadowJars, you cannot extract them with `jar -x`,
as it ends up with an IOException extracting META-INF/license.

This excludes Jackson's META-INF/LICENSE, until we have a better
solution, ideally with one of the proposals in the shadow jar project.

See GradleUp/shadow#86
See GradleUp/shadow#102
@johnrengelman johnrengelman removed this from the 5.0.0 milestone Jan 20, 2019
@Goooler Goooler deleted the branch GradleUp:main July 28, 2024 13:54
@Goooler Goooler closed this Jul 28, 2024
@Goooler Goooler reopened this Jul 28, 2024
@Goooler Goooler changed the base branch from master to main July 28, 2024 14:06
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

Successfully merging this pull request may close these issues.

4 participants