-
Notifications
You must be signed in to change notification settings - Fork 31
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
Better support for profiles in transitive Maven pom.xmls #463
Comments
Ah - good spot on |
There's another related issue in e.g. <dependencies>
<dependency>
<groupId>com.xyz</groupId>
<artifactId>foo</artifactId>
</dependency>
</dependencies>
<profiles>
<profile>
<id>profile1</id> <!-- this profile is not active -->
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.xyz</groupId>
<artifactId>foo</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
</dependencyManagement>
</profile>
<profile>
<id>profile2</id> <!-- this profile is active -->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.xyz</groupId>
<artifactId>foo</artifactId>
<version>1.0.2</version>
</dependency>
</dependencies>
</dependencyManagement>
</profile>
</profiles> gets patched to <dependencies>
<dependency>
<groupId>com.xyz</groupId>
<artifactId>foo</artifactId>
</dependency>
</dependencies>
<profiles>
<profile>
<id>profile1</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.xyz</groupId>
<artifactId>foo</artifactId>
<version>2.0.0</version> <!-- Only this version is changed -->
</dependency>
</dependencies>
</dependencyManagement>
</profile>
<profile>
<id>profile2</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.xyz</groupId>
<artifactId>foo</artifactId>
<version>1.0.2</version> <!-- The version in the activated profile doesn't get patched -->
</dependency>
</dependencies>
</dependencyManagement>
</profile>
</profiles> If there's also a |
This issue has not had any activity for 60 days and will be automatically closed in two weeks See https://github.com/google/osv-scanner/blob/main/CONTRIBUTING.md for how to contribute a PR if you're interested in helping out. |
Edit: I've transferred this issue from osv-scanner, since the relevant logic would now live here.
osv-scanner scan
would correspond to thepomxmlnet
Extractor.osv-scanner fix
is the guided remediation feature.Currently,
osv-scanner scan
does not activate any Maven profiles(?), andosv-scanner fix
activates only profiles that are explicitly active by default.For better profile support, we could:
mvn
's--activate-profiles
/-P
flag)mvn
's--define
/-D
flag to define properties outside of thepom.xml
fileThe text was updated successfully, but these errors were encountered: