Skip to content

Commit

Permalink
Revert "Correctly set active recipe in test"
Browse files Browse the repository at this point in the history
This reverts commit 870d9ef.
  • Loading branch information
Samuel Cox authored and crankydillo committed Oct 30, 2024
1 parent 420a7b8 commit 7494183
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1262,12 +1262,15 @@ void indirectBomImportedFromParent() {
void activeByDefault() {
// Trying to mimic settings.xml activeProfile or `mvn -Pfoobar`
final String activeProfile = "foobar";
// I don't think this is having the affect I want:(
rewriteRun(recipeSpec -> recipeSpec.executionContext(
MavenExecutionContextView.view(new InMemoryExecutionContext())
.setActiveProfiles(Collections.singletonList(activeProfile))
),
mavenProject("c",
rewriteRun(recipeSpec -> {
final ExecutionContext context = new InMemoryExecutionContext();
// I don't think this is having the affect I want:(
recipeSpec.executionContext(
MavenExecutionContextView.view(context)
.setActiveProfiles(Collections.singletonList(activeProfile))
);

}, mavenProject("c",
pomXml(
"""
<project>
Expand Down Expand Up @@ -1315,7 +1318,9 @@ void activeByDefault() {
</profile>
</profiles>
</project>
"""
""", spec -> {
((MavenParser.Builder) spec.getParser()).activeProfiles(activeProfile);
}
)
),
mavenProject("a",
Expand All @@ -1342,6 +1347,7 @@ void activeByDefault() {
</dependencies>
</project>
""", spec -> {
((MavenParser.Builder) spec.getParser()).activeProfiles(activeProfile);
spec.afterRecipe(pomXml -> {
final Map<String, List<ResolvedDependency>> deps =
pomXml.getMarkers()
Expand Down

0 comments on commit 7494183

Please sign in to comment.