Skip to content
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

Duplicate xsd entries are not created in assembled artifacts #13846

Closed
wants to merge 3 commits into from

Conversation

erichaagdev
Copy link
Contributor

@erichaagdev erichaagdev commented Sep 18, 2023

This change prevents the .xsd entries that would appear in the top level of the assembled artifacts. This occurred because the output of the rncToXsd task does not consider the path beneath the resources directory (i.e. org/springframework/security/config/).

To fix this, I configured the processResources task directly with a copy spec so the required path could be set, rather than via the source sets container. This follows a similar pattern to the recent changes in #13819 to create the versionless .xsd.

Once I configured the resources in this way, some deprecations resurfaced that were attempted to be addressed by the original #13668 issue. This explains the last 2 commits.

Here we can see the duplicate files are no longer created:

$ ./gradlew :spring-security-config:versionlessXsd
$ find config/build -name "spring-security-config-*-SNAPSHOT.jar" | xargs unzip -l | grep xsd
   182205  09-18-2023 12:17   org/springframework/security/config/spring-security-5.8.xsd
    60116  09-18-2023 12:17   org/springframework/security/config/spring-security-2.0.1.xsd
    64570  09-18-2023 12:17   org/springframework/security/config/spring-security-2.0.2.xsd
    76866  09-18-2023 12:17   org/springframework/security/config/spring-security-3.0.3.xsd
    66970  09-18-2023 12:17   org/springframework/security/config/spring-security-2.0.4.xsd
   177520  09-18-2023 12:17   org/springframework/security/config/spring-security.xsd
   177520  09-18-2023 12:17   org/springframework/security/config/spring-security-6.0.xsd
   134962  09-18-2023 12:17   org/springframework/security/config/spring-security-4.2.xsd
   177520  09-18-2023 12:17   org/springframework/security/config/spring-security-6.1.xsd
   133053  09-18-2023 12:17   org/springframework/security/config/spring-security-4.1.xsd
   126183  09-18-2023 12:17   org/springframework/security/config/spring-security-4.0.xsd
   177520  09-18-2023 12:17   org/springframework/security/config/spring-security-6.2.xsd
    56498  09-18-2023 12:17   org/springframework/security/config/spring-security-2.0.xsd
   129773  09-18-2023 12:17   org/springframework/security/config/spring-security-5.1.xsd
   128952  09-18-2023 12:17   org/springframework/security/config/spring-security-5.0.xsd
   129937  09-18-2023 12:17   org/springframework/security/config/spring-security-5.2.xsd
   148533  09-18-2023 12:17   org/springframework/security/config/spring-security-5.3.xsd
   175341  09-18-2023 12:17   org/springframework/security/config/spring-security-5.7.xsd
   111756  09-18-2023 12:17   org/springframework/security/config/spring-security-3.1.xsd
    75687  09-18-2023 12:17   org/springframework/security/config/spring-security-3.0.xsd
   154273  09-18-2023 12:17   org/springframework/security/config/spring-security-5.6.xsd
   149651  09-18-2023 12:17   org/springframework/security/config/spring-security-5.4.xsd
   120998  09-18-2023 12:17   org/springframework/security/config/spring-security-3.2.xsd
   150842  09-18-2023 12:17   org/springframework/security/config/spring-security-5.5.xsd

This change removes .xsd entries that would appear in the top level of
the assembled artifacts. This occurred because the output of the
rncToXsd task does not consider the path beneath the resources
directory. To fix this, the processResources task is directly
configured with a copy spec so the required path can be set.
Since processResources is configured directly instead of via the source
set container, an explicit dependency task between rncToXsd and
versionlessXsd must be defined.
Since processResources is configured directly instead of via the source
set container, an explicit dependency task between rncToXsd and
sourcesJar must be defined.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 18, 2023
@marcusdacoregio marcusdacoregio self-assigned this Sep 19, 2023
@marcusdacoregio marcusdacoregio added in: build An issue in the build type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 19, 2023
@marcusdacoregio marcusdacoregio added this to the 5.8.8 milestone Sep 19, 2023
@marcusdacoregio
Copy link
Contributor

Thanks, @erichaagdev, this is now merged via 718c470 e63d7fd and ac04c2e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: build An issue in the build type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants