-
Notifications
You must be signed in to change notification settings - Fork 359
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
Support profile activation in Maven pom.xml resolution and writing #1239
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 |
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: