-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
When using Maven, configuring the spring-boot.excludes or spring-boot-includes user properties causes the build to fail with "Cannot find default setter" #39837
Conversation
I think this is a bug. We already expose the excludes as a property: Line 88 in 2c4fb5b
It's included in the documentation as well but it doesn't work:
|
Now that it works (after this change) and I have the branch open in my NetBeans, should I also add an example of the property syntax to the doc 🤔 Or is it too obvious? |
Additional note: the string syntax also doesn't in this change yet support classifier. Not sure if very often needed though 🤷♂️ |
Yes, please. An example in the docs would be good. I think we should also assert the format in the setter with something like this:
Some tests would be very welcome too please. |
That's a good point. I think classifiers should be supported otherwise the property doesn't meet its goal of providing an alternative to XML-based configuration. My proposed assertion above would have to be updated to take this into account. |
Yeah, I think at least some integration test at least. @snicoll just hinted me to the correct directory 👍 |
* JavaDoc showing the syntax * Support for optional classifier * More meaningful error with invalid parameters
Also fixed a related existing test that has been false positive since spring boot 3.
✅ Discussed changes in. Also fixed a related IT that had been false positive since Spring Boot 3. |
...g-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/JarIntegrationTests.java
Show resolved
Hide resolved
@wilkinsona Was there still something missing from this PR. Would love to get forward with my prototype that would require this, but wouldn't like to work with own snapshots (testing would be deployments to could environments that'd build my apps with buildpacks...). |
No, nothing's missing from the PR, we just have a lot on at the moment. We'll get to this as soon as we can. Thanks for your patience in the meantime. |
@@ -195,10 +195,25 @@ void whenAnEntryIsExcludedItDoesNotAppearInTheRepackagedJar(MavenBuild mavenBuil | |||
.hasEntryWithNameStartingWith("BOOT-INF/lib/spring-context") | |||
.hasEntryWithNameStartingWith("BOOT-INF/lib/spring-core") | |||
.hasEntryWithNameStartingWith("BOOT-INF/lib/spring-jcl") | |||
.doesNotHaveEntryWithName("BOOT-INF/lib/servlet-api-2.5.jar"); | |||
.doesNotHaveEntryWithNameStartingWith("BOOT-INF/lib/jakarta.servlet-api-"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change could result in the test passing when it should not. The exclude is targeting this dependency:
Lines 43 to 48 in d642d35
<dependency> | |
<groupId>javax.servlet</groupId> | |
<artifactId>servlet-api</artifactId> | |
<version>2.5</version> | |
<scope>provided</scope> | |
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll revert it when merging.
The change makes excludes configurable via CLI.
For example this:
Would equal to following pom.xml configuration: