-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Force attach sources with non "jar" artifacts #18396
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sonatype rule `sources-staging` force to provide a `*-sources.jar` artifact. This PR generates the source jar even if there is no related java code by considering the `pom.xml` file as a source file. We could set this globally on the project but I prefer being cautious here and just add this to the projects which are not generating source files archive for now. When you run it on distribution packages or site-example plugin, you now get: ``` [INFO] --- maven-source-plugin:2.4:jar (attach-sources) @ site-example --- [INFO] Building jar: /Users/dpilato/Documents/Elasticsearch/dev/es-2x/elasticsearch/plugins/site-example/target/site-example-2.4.0-SNAPSHOT-sources.jar ``` Was previously: ``` [INFO] --- maven-source-plugin:2.4:jar (attach-sources) @ site-example --- [INFO] No sources in project. Archive not created. ```
Contributor
|
LGTM |
dadoonet
added a commit
that referenced
this pull request
May 17, 2016
Sonatype rule `sources-staging` force to provide a `*-sources.jar` artifact. This PR generates the source jar even if there is no related java code by considering the `pom.xml` file as a source file. We could set this globally on the project but I prefer being cautious here and just add this to the projects which are not generating source files archive for now. When you run it on distribution packages or site-example plugin, you now get: ``` [INFO] --- maven-source-plugin:2.4:jar (attach-sources) @ site-example --- [INFO] Building jar: /Users/dpilato/Documents/Elasticsearch/dev/es-2x/elasticsearch/plugins/site-example/target/site-example-2.4.0-SNAPSHOT-sources.jar ``` Was previously: ``` [INFO] --- maven-source-plugin:2.4:jar (attach-sources) @ site-example --- [INFO] No sources in project. Archive not created. ``` Backport of #18396 in 2.3 branch (cherry picked from commit 9ec001b)
dadoonet
added a commit
to dadoonet/elasticsearch
that referenced
this pull request
May 17, 2016
Follow up for elastic#18396: which is reverted with this change When you upload any `jar` artifact you have to provide the `jar` file, javadocs and sources. For distribution, we changed from `pom` artifact to `jar` in order to be able to run integration tests. But we never generate any jar, sources or javadoc because they don't exist. This PR adds a FAKE file in `src/main/resources`. So Maven is able to generate the JAR file which is uploaded to Sonatype. Sources are then automatically added. To generate the javadoc file, we need also to tell maven that javadoc will be based on this `src/main/resources` dir. As a file exists in it, javadoc is generated as well. ``` [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ elasticsearch --- [INFO] Installing /Users/dpilato/Documents/Elasticsearch/dev/es-2x/elasticsearch/distribution/zip/target/elasticsearch-2.4.0-SNAPSHOT.jar to /Users/dpilato/.m2/repository/org/elasticsearch/distribution/zip/elasticsearch/2.4.0-SNAPSHOT/elasticsearch-2.4.0-SNAPSHOT.jar [INFO] Installing /Users/dpilato/Documents/Elasticsearch/dev/es-2x/elasticsearch/distribution/zip/pom.xml to /Users/dpilato/.m2/repository/org/elasticsearch/distribution/zip/elasticsearch/2.4.0-SNAPSHOT/elasticsearch-2.4.0-SNAPSHOT.pom [INFO] Installing /Users/dpilato/Documents/Elasticsearch/dev/es-2x/elasticsearch/distribution/zip/target/elasticsearch-2.4.0-SNAPSHOT-javadoc.jar to /Users/dpilato/.m2/repository/org/elasticsearch/distribution/zip/elasticsearch/2.4.0-SNAPSHOT/elasticsearch-2.4.0-SNAPSHOT-javadoc.jar [INFO] Installing /Users/dpilato/Documents/Elasticsearch/dev/es-2x/elasticsearch/distribution/zip/target/elasticsearch-2.4.0-SNAPSHOT-sources.jar to /Users/dpilato/.m2/repository/org/elasticsearch/distribution/zip/elasticsearch/2.4.0-SNAPSHOT/elasticsearch-2.4.0-SNAPSHOT-sources.jar [INFO] Installing /Users/dpilato/Documents/Elasticsearch/dev/es-2x/elasticsearch/distribution/zip/target/releases/elasticsearch-2.4.0-SNAPSHOT.zip to /Users/dpilato/.m2/repository/org/elasticsearch/distribution/zip/elasticsearch/2.4.0-SNAPSHOT/elasticsearch-2.4.0-SNAPSHOT.zip ```
dadoonet
added a commit
that referenced
this pull request
May 17, 2016
Follow up for #18396: which is reverted with this change When you upload any `jar` artifact you have to provide the `jar` file, javadocs and sources. For distribution, we changed from `pom` artifact to `jar` in order to be able to run integration tests. But we never generate any jar, sources or javadoc because they don't exist. This PR adds a FAKE file in `src/main/resources`. So Maven is able to generate the JAR file which is uploaded to Sonatype. Sources are then automatically added. To generate the javadoc file, we need also to tell maven that javadoc will be based on this `src/main/resources` dir. As a file exists in it, javadoc is generated as well. ``` [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ elasticsearch --- [INFO] Installing /Users/dpilato/Documents/Elasticsearch/dev/es-2x/elasticsearch/distribution/zip/target/elasticsearch-2.4.0-SNAPSHOT.jar to /Users/dpilato/.m2/repository/org/elasticsearch/distribution/zip/elasticsearch/2.4.0-SNAPSHOT/elasticsearch-2.4.0-SNAPSHOT.jar [INFO] Installing /Users/dpilato/Documents/Elasticsearch/dev/es-2x/elasticsearch/distribution/zip/pom.xml to /Users/dpilato/.m2/repository/org/elasticsearch/distribution/zip/elasticsearch/2.4.0-SNAPSHOT/elasticsearch-2.4.0-SNAPSHOT.pom [INFO] Installing /Users/dpilato/Documents/Elasticsearch/dev/es-2x/elasticsearch/distribution/zip/target/elasticsearch-2.4.0-SNAPSHOT-javadoc.jar to /Users/dpilato/.m2/repository/org/elasticsearch/distribution/zip/elasticsearch/2.4.0-SNAPSHOT/elasticsearch-2.4.0-SNAPSHOT-javadoc.jar [INFO] Installing /Users/dpilato/Documents/Elasticsearch/dev/es-2x/elasticsearch/distribution/zip/target/elasticsearch-2.4.0-SNAPSHOT-sources.jar to /Users/dpilato/.m2/repository/org/elasticsearch/distribution/zip/elasticsearch/2.4.0-SNAPSHOT/elasticsearch-2.4.0-SNAPSHOT-sources.jar [INFO] Installing /Users/dpilato/Documents/Elasticsearch/dev/es-2x/elasticsearch/distribution/zip/target/releases/elasticsearch-2.4.0-SNAPSHOT.zip to /Users/dpilato/.m2/repository/org/elasticsearch/distribution/zip/elasticsearch/2.4.0-SNAPSHOT/elasticsearch-2.4.0-SNAPSHOT.zip ``` Backport of #18404 in 2.3 branch: (cherry picked from commit f9d1db6)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
:Delivery/Build
Build or test infrastructure
Team:Delivery
Meta label for Delivery team
v2.3.3
v2.4.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sonatype rule
sources-stagingforce to provide a*-sources.jarartifact.This PR generates the source jar even if there is no related java code by considering the
pom.xmlfile as a source file.We could set this globally on the project but I prefer being cautious here and just add this to the projects which are not generating source files archive for now.
When you run it on distribution packages or site-example plugin, you now get:
Was previously: