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

Dont skip POM modules #79

Open
delanym opened this issue Sep 14, 2022 · 2 comments
Open

Dont skip POM modules #79

delanym opened this issue Sep 14, 2022 · 2 comments

Comments

@delanym
Copy link

delanym commented Sep 14, 2022

I added the enforcer rule to my bom project, since that's where all the dependencies are set, but the rule is skipped. Can it rather not skip, or have an option to skip?

[DEBUG] Executing rule: org.sonatype.ossindex.maven.enforcer.BanVulnerableDependencies
[DEBUG] Skipping BanVulnerableDependencies; POM module
@jdillon
Copy link
Collaborator

jdillon commented Sep 19, 2022

Maven does not really do any resolution of dependencies for POM modules, hence why the invocation is skipped here.
You are much better off to use non-pom modules (ie. packaging=jar, etc) to inspect the dependencies that actually resolved and included as part of the dependency tree for that module.

@delanym
Copy link
Author

delanym commented Sep 19, 2022

I dont agree. If the dependencies are not resolved, they are nevertheless available for inspection. I dont want my bom project published to Nexus with known vulnerabilities. Blocking them at source is much more helpful. I only have to build the bom to see what vulnerabilities are affecting my platform. Otherwise I have to rebuild each project individually. It makes reporting more difficult.

The workaround Im using is to create a child module of the bom which depends on everything in the bom. (A kind of library bom that I use to source the dependencies for my distribution project). But then this is also a pom, so I have to create another (empty) jar project with this rule in it, and then configure the project to use the hacky installAtEnd/deployAtEnd to prevent the parent bom from publishing if vulnerabilities are found in its modules. It would be far simpler to fail on the bom itself.

Without this workaround I'd be forced to rebuild all my projects continually to check for vulnerabilities. Most of my projects don't change so there's no other reason to build them. But I'm continually rebuilding distributions - a pom project.

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