-
Notifications
You must be signed in to change notification settings - Fork 86
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
<optional> of transitive dependencies when <flattenMavenMode> is "all" #160
Comments
This is a valid issue -- as observed in java-bigtable when we try to add flatten plugin with flattened pom shows:
As a result,
The flatten plugin, with
Notice that "(optional)" is incorrectly set for the transitive dependency (org.hamcrest:hamcrest-core:jar:1.3). This should be addressed before we can implement flatten plugin in GCP cloud client modules that contain @saturnism @olamy FYI |
it looks like the issue is similar to
before flattening, from the perspective of after flattening, it becomes from the but these extra information is unnecessary can prob be removed in the final flattened pom. |
@stephaniewang526 pointed out the bigger issue I misread from the initial description:
but from perspective of from |
First, we need to make sure that we use dependency-plugin:3.1.2 to generate the dependency list, otherwise there will not show "(optional)" for optional dependencies in the pom. Second, for lib A -> lib B (optional) -> lib C, if checking the dependency:tree or dependency:list of A, we can find out that lib C will be still in the class path of A but set as "optional", i.e. lib A -> lib B (optional) -> lib C(optional). So I think we need to keep the lib C in the flattened A, i.e. lib A (flattened) -> lib B (optional) and lib C (optional). |
… its transitive dependencies and set them as optional
Looks like using the correct version of maven-dependency-plugin (3.1.2) is key to showing |
When I tried to flatten a pom with dependencies whose is "true" and set flattenDependencyMode == all, I got a flattened pom which parsed the transitive dependencies but with the as "false". I am wondering if it is a potential problem.
The pom we want to flatten contains dependencies:
The core has transitive dependency:
What I got in the flattened pom:
The text was updated successfully, but these errors were encountered: