Skip to content

Commit

Permalink
Remove outdated optional transitive recommended pdep restriction (#1756)
Browse files Browse the repository at this point in the history
  • Loading branch information
wi11dey authored Jan 9, 2025
1 parent 1666c0a commit 06bc942
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 50 deletions.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-1756.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Remove outdated optional transitive recommended pdep restriction
links:
- https://github.com/palantir/sls-packaging/pull/1756
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ public final void productDependency(@DelegatesTo(ProductDependency.class) Closur
recommendedProductDependencies.add(providerFactory.provider(() -> {
ProductDependency dep = new ProductDependency();
project.configure(dep, closure);
if (dep.getOptional()) {
throw new IllegalArgumentException(String.format(
"Optional dependencies are not supported for recommended product "
+ "dependencies. Please remove optional for dependency %s",
dep));
}
dep.isValid();
return dep;
}));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class RecommendedProductDependenciesPluginIntegrationSpec extends IntegrationSpe
minimumVersion = '1.0.0'
maximumVersion = '1.x.x'
recommendedVersion = '1.2.3'
optional = true
}
}
""".stripIndent()
Expand All @@ -62,6 +63,7 @@ class RecommendedProductDependenciesPluginIntegrationSpec extends IntegrationSpe
dep.minimumVersion == "1.0.0"
dep.maximumVersion == "1.x.x"
dep.recommendedVersion == "1.2.3"
dep.optional
}

def 'Jar includes recommended product dependencies'() {
Expand Down
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,14 +424,13 @@ recommendedProductDependencies {
minimumVersion = rootProject.version
maximumVersion = "${rootProject.version.tokenize('.')[0].toInteger()}.x.x"
recommendedVersion = rootProject.version
optional = true
}
}
```

The recommended product dependencies will be serialized into the jar manifest of the jar that the project produces. The SLS distribution and asset plugins will inspect the manifest of all jars in the server or asset and extract the recommended product dependencies.

Marking a product dependency as optional in recommendedProductDependencies [is not currently supported](https://github.com/palantir/sls-packaging/issues/1208).

## License

This plugin is made available under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).

0 comments on commit 06bc942

Please sign in to comment.