-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Stop packaging optional dependencies by default in our Maven plugin and provide an option to opt back in #25403
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
Comments
This is intentional but I don't think the documentation is clear, or if it is, I've failed to find the relevant section. The inclusion of provided dependencies is mentioned in the documentation on how to exclude dependencies. Optional dependencies aren't mentioned as far as I can see. The exclusion approach is what you should use at the moment. #16563 and #22030 are tracking some improvements to it. I'm wondering if we should rethink the approach to optional dependencies. Maven's documentation says the following:
Maven's own war plugin aligns with this general description and does not package optional dependencies, although some people would like it to do so. |
this extension would be great. It is a bit unlcear for other developers if they see that the dependencies must be explicitly excluded if they have already been set to optional=true. |
@wilkinsona the exclusion approach is completely impractical. |
@wilkinsona I'm trying to make the point that it should not relate to optional - but to 'provided' scopes too. thanks for the heads up re #13289 |
Could you please consider provide a configuration switch for spring boot 2.x and default for 3.x. Another use case, I use |
for my case, and for anyone else looking for a sledgehammer solution, here's what I'm doing to 'fix' my issue. <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>truezip-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>remove-a-file</id>
<goals>
<goal>remove</goal>
</goals>
<phase>package</phase>
<configuration>
<fileset>
<!-- note how the archive is treated as a normal file directory -->
<directory>${project.build.directory}/${project.build.finalName}.${project.packaging}</directory>
<includes>
<include>BOOT-INF/lib/*.swc</include>
<include>BOOT-INF/lib/framework-4.1.0.16076-configs.zip</include>
</includes>
</fileset>
</configuration>
</execution>
</executions>
</plugin> |
We need to exclude some of our dependencies because these dependencies must be provided by the customer due to license restrictions but the maven plugin is ignoring
<scope>provided</scope>
and also ignores<optional>true</optional>
...The text was updated successfully, but these errors were encountered: