-
Notifications
You must be signed in to change notification settings - Fork 9
Add ability to publish to bintray and central #3
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
BenFradet
merged 8 commits into
snowplow-referer-parser:develop
from
wiktorolko:develop
Oct 31, 2018
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
763f011
Add maven-plugin to enable releasing to maven repository
wiktorolko 5c792e4
Update build.gradle in order to be able to deploy to mavenCentral
wiktorolko e4f72d3
Fix javadoc errors
wiktorolko 2df5600
Invoke signing only when releasing the jar to mavenCentral
wiktorolko c6cacf5
Use bintray plugin to publish artifacts to maven central. Add deploy …
wiktorolko abf96fc
Delete gradle.properties file as credentials stored there are no long…
wiktorolko 541be04
Code review follow-up: minor updates in the build.gradle
wiktorolko 6c46768
Make the deploy.sh executable
wiktorolko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/bin/bash | ||
|
|
||
| tag_version=$1 | ||
|
|
||
| cd $TRAVIS_BUILD_DIR | ||
| pwd | ||
|
|
||
| project_version=`cat VERSION` | ||
| if [ "${project_version}" == "${tag_version}" ]; then | ||
| ./gradlew bintrayUpload | ||
| else | ||
| echo "Tag version '${tag_version}' doesn't match version in project ('${project_version}'). Aborting!" | ||
| exit 1 | ||
| fi |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,13 @@ | ||
| plugins { | ||
| id 'java' | ||
| id 'maven-publish' | ||
| id 'com.jfrog.bintray' version '1.8.4' | ||
| } | ||
|
|
||
| group = 'com.snowplowanalytics' | ||
| archivesBaseName = 'java-referer-parser' | ||
| version = '0.4.0' | ||
|
|
||
| sourceCompatibility = '1.8' | ||
| targetCompatibility = '1.8' | ||
|
|
||
|
|
@@ -16,4 +20,82 @@ dependencies { | |
| compile 'org.apache.httpcomponents:httpclient:4.5.3' | ||
| testCompile 'junit:junit:4.12' | ||
| testCompile 'org.json:json:20180813' | ||
| } | ||
|
|
||
| bintray { | ||
| user = System.getenv('BINTRAY_USER') | ||
| key = System.getenv('BINTRAY_API_KEY') | ||
|
|
||
| pkg { | ||
| repo = 'snowplow-maven' | ||
| name = archivesBaseName | ||
| licenses = ['Apache-2.0'] | ||
| vcsUrl = 'https://github.com/snowplow-referer-parser/java-referer-parser.git' | ||
| } | ||
| publications = ['mavenJava'] | ||
| version { | ||
| name = version | ||
| gpg { | ||
| sign = true | ||
| } | ||
| mavenCentralSync { | ||
| sync = true | ||
| user = System.getenv('SONA_USER') | ||
| password = System.getenv('SONA_PASS') | ||
| } | ||
| } | ||
| } | ||
|
|
||
| task javadocJar(type: Jar) { | ||
| classifier = 'javadoc' | ||
| from javadoc | ||
| } | ||
|
|
||
| task sourcesJar(type: Jar) { | ||
| classifier = 'sources' | ||
| from sourceSets.main.allSource | ||
| } | ||
|
|
||
| def pomConfig = { | ||
| licenses { | ||
| license { | ||
| name "The Apache Software License, Version 2.0" | ||
| url "http://www.apache.org/licenses/LICENSE-2.0.txt" | ||
| distribution "repo" | ||
| } | ||
| } | ||
| developers { | ||
| developer { | ||
| id 'alexanderdean' | ||
| name 'Alexander Dean' | ||
| email '[email protected]' | ||
| } | ||
| } | ||
|
|
||
| scm { | ||
| connection 'https://github.com/snowplow-referer-parser/java-referer-parser.git' | ||
| developerConnection 'https://github.com/snowplow-referer-parser/java-referer-parser.git' | ||
| url 'https://github.com/snowplow-referer-parser/java-referer-parser' | ||
| } | ||
| } | ||
|
|
||
| // Create the publication with the pom configuration: | ||
| publishing { | ||
| publications { | ||
| mavenJava(MavenPublication) { | ||
| from components.java | ||
| artifact sourcesJar | ||
| artifact javadocJar | ||
| groupId group | ||
| artifactId 'java-referer-parser' | ||
| version version | ||
| pom.withXml { | ||
| def root = asNode() | ||
| root.appendNode('description', 'This is the Java implementation of referer-parser, the library for extracting attribution data from referer (sic) URLs.') | ||
| root.appendNode('name', 'Java Referer Parser') | ||
| root.appendNode('url', 'https://github.com/snowplow-referer-parser/java-referer-parser') | ||
| root.children().last() + pomConfig | ||
| } | ||
| } | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| enableFeaturePreview('STABLE_PUBLISHING') |
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
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
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
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.
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 don't think we have a key so this will most likely fail
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.
It's obligatory to have signing enabled.
https://github.com/bintray/gradle-bintray-plugin#Maven_Central_Sync
Here is an article how to create a signature:
https://medium.com/@nmauti/publishing-a-project-on-maven-central-8106393db2c3
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.
ah indeed, didn't know bintray did it for us: https://github.com/bintray/gradle-bintray-plugin#gpg-file-signing