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

Problem on resolving dependencies with add-third-party even when skipping goal #509

Open
SvenT23 opened this issue Jul 4, 2023 · 1 comment

Comments

@SvenT23
Copy link

SvenT23 commented Jul 4, 2023

I have a parent project A which defines some standards, versions and configuration which is applicable for all our projects. This is basically just a pom and defines the license-maven-plugin in a profile with all the valid licenses and both the add-third-party and aggregate-add-third-party goals.

Besides this I have multiple projects using the above pom as a parent, and one of those projects is a multimodule project B containing 2 submodules BC and BD. Both have B as their parent and are defined as modules in the pom of B. BD also depends on BC.

|- A
|- B
    |- BC
    |- BD

Now if I run the license check for project B while using the skipAddThirdParty flag to skip the add-third-party goal:

  • project B skips the add-third-party goal and runs the aggregate-add-third-party goal combining all of the licenses, which is great
  • project BC skips the add-third-party goal because of the flag and skips the aggregate-add-third-party goal "due to packaging jar", which again is exactly what I want
  • project BD fails because it "Could not resolve dependencies for project BC".

I am able to solve this by either:

  • running a maven install before the license check, so the dependency is known to maven by installing it in the local repository
  • running the license-check with the maven "package" goal, building the code (again) so the dependency is known to maven
  • removing the add-third-party goal entirely in parent project A (which isn't really an option because we also have single module projects as well)

There are good reasons why we don't want to do any of the above options, but I'm also just confused that the aggregate-add-third-party goal seems to be working fine and doesn't mind the "missing" dependency while the add-third-party goal which I am trying to skip entirely does still stumble on that dependency even though the goal would be skipped even if the dependency was available.

Would there be any way to fix this? Or maybe I'm just doing something wrong?

@slawekjaranowski
Copy link
Member

please provide a simple project which help to reproduce your issue.

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