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

Maven Shade support #5967

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

Conversation

smowton
Copy link
Contributor

@smowton smowton commented May 28, 2021

No description provided.

@smowton smowton requested a review from a team as a code owner May 28, 2021 15:02
@github-actions github-actions bot added the Java label May 28, 2021

class MavenShadePlugin extends MavenPlugin {
MavenShadePlugin() {
this.getGroup().getValue() = "org.apache.maven.plugins" and
Copy link
Contributor

Choose a reason for hiding this comment

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

The groupId is optional, see https://stackoverflow.com/a/65533111.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, done

MavenShadePlugin plugin;

MavenShadeRelocation() {
this.getParent().(XMLElement).getParent().(XMLElement).getParent() = plugin and
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be good to add a comment explaining the hierarchy here, i.e. plugin -> configuration -> relocations -> relocation

It is also possible to specify the configuration per execution, as it was done in the example of the Maven Shade Plugin, see also the POM Reference.

Yaml() { this.getASupertype*().hasQualifiedName("org.yaml.snakeyaml", "Yaml") }
Yaml() {
this.getASupertype*()
.hasQualifiedName(getAShadedPackage("org.yaml.snakeyaml.constructor"), "Yaml")
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this changed on purpose, shouldn't it be the following? (might require formatting)

Suggested change
.hasQualifiedName(getAShadedPackage("org.yaml.snakeyaml.constructor"), "Yaml")
.hasQualifiedName(getAShadedPackage("org.yaml.snakeyaml"), "Yaml")

java/ql/src/semmle/code/xml/MavenPom.qll Outdated Show resolved Hide resolved
@smowton
Copy link
Contributor Author

smowton commented Jun 10, 2021

Thanks, changes applied

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants