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

Fix double-source-jar error during releases: #6755

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Conversation

copybara-service[bot]
Copy link
Contributor

@copybara-service copybara-service bot commented Oct 6, 2023

Fix double-source-jar error during releases:

Building and deploying the android flavor (this may take a while)...
[ERROR] We have duplicated artifacts attached.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-source-plugin:3.3.0:jar (attach-sources) on project guava: Presumably you have configured maven-source-plugn to execute twice times in your build. You have to configure a classifier for at least on of them. -> [Help 1]

I had fixed the same issue with snapshot deployment in cl/559489724 (by no longer passing source:jar to mvn), but apparently that fix doesn't apply to release deployment. I'm guessing that the relevant part of our release command is -Psonatype-oss-release, which (among other things) activates a maven-source-plugin configuration change: Presumably that introduces a second maven-source-plugn execution in much the same way as passing source:jar does.

I previously fixed a similar problem in jimfs (cl/536746714) by removing the "normal" maven-source-plugin configuration, leaving only the sonatype-oss-release configuration in the parent.

I don't remember whether I investigated removing jimfs' sonatype-oss-release configuration instead. Probably I should have at least investigated, since that's what we're going with here.

As best I can tell, this doesn't interfere with snapshot source jars, which are produced even without source:jar.

(Notice that the configuration that may be the source of the problem was copied from the old oss-parent pom. This is at least the second time that that pom's configuration has caused us trouble, the other I recall being cl/492304151—well, and probably the aforementioned jimfs source-jar issue, too.)

This prepares for the release that contains the fix for #6634, among other issues.

RELNOTES=n/a

```
Building and deploying the android flavor (this may take a while)...
[ERROR] We have duplicated artifacts attached.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-source-plugin:3.3.0:jar (attach-sources) on project guava: Presumably you have configured maven-source-plugn to execute twice times in your build. You have to configure a classifier for at least on of them. -> [Help 1]
```

I had fixed the same issue with _snapshot_ deployment in cl/559489724 (by no longer passing `source:jar` to `mvn`), but apparently that fix doesn't apply to _release_ deployment. I'm guessing that the relevant part of our release command is `-Psonatype-oss-release`, which (among other things) [activates a `maven-source-plugin` configuration change](https://github.com/google/guava/blob/a78bea41aedba50469641968ee3d98b24836e491/pom.xml#L329-L334): Presumably that introduces a second `maven-source-plugn` execution in much the same way as passing `source:jar` does.

I previously fixed a similar problem in jimfs (cl/536746714) by removing the "normal" `maven-source-plugin` configuration, leaving only the `sonatype-oss-release` configuration in the parent.

I don't remember whether I investigated removing jimfs' `sonatype-oss-release` configuration instead. Probably I should have at least investigated, since that's what we're going with here.

As best I can tell, this doesn't interfere with _snapshot_ source jars, which are produced even without `source:jar`.

(Notice that the configuration that may be the source of the problem was copied from the old `oss-parent` pom. This is at least the second time that that pom's configuration has caused us trouble, the other I recall being cl/492304151—well, and probably the aforementioned jimfs source-jar issue, too.)

This prepares for the release that contains the fix for #6634, among other issues.

RELNOTES=n/a
PiperOrigin-RevId: 572327204
@copybara-service copybara-service bot merged commit db3017f into master Oct 10, 2023
1 check passed
@copybara-service copybara-service bot deleted the test_571437790 branch October 10, 2023 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant