Skip to content

Commit c7576f7

Browse files
authored
Merge pull request #1164 from watson-developer-cloud/maven-transition
Maven transition
2 parents 7a06e39 + 3569303 commit c7576f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1731
-1973
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ commit = True
44
message = Update version numbers from {current_version} -> {new_version}
55
search = {current_version}
66
replace = {new_version}
7-
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?P<rc>\-rc\.\d+)?
8-
serialize =
9-
{major}.{minor}.{patch}{rc}
10-
{major}.{minor}.{patch}
11-
12-
[bumpversion:file:gradle.properties]
137

148
[bumpversion:file:README.md]
159

.github/CONTRIBUTING.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,24 @@ If you encounter an issue with the Java SDK, you are welcome to submit a [bug re
44
Before that, please search for similar issues. It's possible somebody has encountered this issue already.
55

66
# Building and testing
7-
This project uses [Gradle] as the build tool (> v1.x). Here are some helpful commands:
7+
This project uses [Maven] as the build tool (> v1.x). Here are some helpful commands:
88
```sh
99
cd java-sdk
10-
gradle jar # build jar file (build/libs/watson-developer-cloud-6.14.0.jar)
11-
gradle test # run tests
12-
gradle check # performs quality checks on source files and generates reports
13-
gradle testReport # run tests and generate the aggregated test report (build/reports/allTests)
14-
gradle codeCoverageReport # run tests and generate the code coverage report (build/reports/jacoco)
10+
mvn clean # Delete target directory.
11+
mvn test # Run tests
12+
mvn package # Take the compiled code and package it in its distributable format, e.g. JAR.
13+
mvn verify # Run any checks to verify the MVN package is valid and meets quality criteria.
14+
mvn verify -fae -DskipITs=false # Run Integration tests to verify the MVN package is valid and meets quality criteria.
15+
mvn install # Install the package into the local maven repository cache.
1516
```
1617

1718
# Pull Requests
1819

1920
If you want to contribute to the repository, here's a quick guide:
2021
1. Fork the repository
2122
1. Edit the [`config.properties`](../common/src/test/resources/config.properties) file to add your service credentials to the appropriate fields.
22-
2. develop and test your code changes, gradle: `gradle test`.
23-
* Run `checkstyle`: `gradle checkstyle`. 🏁
23+
2. develop and test your code changes: `mvn verify -fae -DskipITs=false`.
24+
* Run `checkstyle`: `mvn checkstyle:check`. 🏁
2425
* Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change.
2526
* Check for unnecessary whitespace with git diff --check before committing.
2627
3. Make the test pass

.gitignore

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
.idea
66
.project
77
.settings
8-
build
98
out
109
target
1110
bin/
@@ -36,3 +35,32 @@ package-lock.json
3635
*.py
3736
fix-copyrights.sh
3837
/.utility/secring.gpg
38+
# Compiled class file
39+
*.class
40+
41+
# Log file
42+
*.log
43+
44+
# BlueJ files
45+
*.ctxt
46+
47+
# Mobile Tools for Java (J2ME)
48+
.mtj.tmp/
49+
50+
/**/target/
51+
/**/test-output/
52+
.settings/
53+
.factorypath
54+
*-apiref.json
55+
56+
# Package Files #
57+
*.jar
58+
*.war
59+
*.nar
60+
*.ear
61+
*.zip
62+
*.tar.gz
63+
*.rar
64+
*.key
65+
66+
/node_modules

.releaserc

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,23 @@
11
{
2-
"branches": [
3-
"master",
4-
{
5-
"name": "rc",
6-
"prerelease": true
7-
}
8-
],
92
"debug": true,
3+
"branches": [ "master" ],
4+
"tagFormat": "v${version}",
105
"plugins": [
116
"@semantic-release/commit-analyzer",
127
"@semantic-release/release-notes-generator",
138
"@semantic-release/changelog",
149
[
1510
"@semantic-release/exec",
1611
{
17-
"prepareCmd": ".utility/bumpversion.sh ${lastRelease.version} ${nextRelease.version}"
18-
}
19-
],
20-
[
21-
"@semantic-release/exec",
22-
{
23-
"prepareCmd": "./gradlew clean shadowJar"
12+
"prepareCmd": "bump2version --allow-dirty --current-version ${lastRelease.version} --new-version ${nextRelease.version} patch"
2413
}
2514
],
2615
[
2716
"@semantic-release/git",
2817
{
29-
"message": "docs(release): Add release notes for ${nextRelease.version}"
18+
"message": "chore(release): ${nextRelease.version} release notes\n\n${nextRelease.notes}"
3019
}
3120
],
32-
[
33-
"@semantic-release/github",
34-
{
35-
"assets": [
36-
{
37-
"path": "ibm-watson/build/libs/*.jar",
38-
"name": "ibm-watson-${nextRelease.version}-jar-with-dependencies.jar"
39-
}
40-
]
41-
}
42-
]
21+
"@semantic-release/github"
4322
]
44-
}
23+
}

.travis.yml

Lines changed: 52 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,78 @@
1+
---
2+
language: java
13
dist: xenial
24
os: linux
5+
6+
jdk:
7+
- openjdk8
8+
9+
notifications:
10+
email: true
11+
312
branches:
413
except:
514
- gh-pages
15+
16+
cache:
17+
directories:
18+
- "$HOME/.m2"
19+
20+
env:
21+
global:
22+
- MVN_ARGS="--settings build/.travis.settings.xml"
23+
624
stages:
7-
- Build and test
8-
- Semantic release
9-
- Publish javadoc
10-
- Upload Archives
25+
- name: Build and test
26+
- name: Semantic-Release
27+
if: branch = master AND type = push AND fork = false
28+
- name: Publish-Release
29+
if: tag IS present
1130

1231
jobs:
1332
include:
1433
- stage: Build and test
1534
jdk: openjdk8
1635
language: java
17-
before_install:
18-
- .utility/decrypt-service-instance-apikeys.sh
36+
install:
37+
- curl -s https://codecov.io/bash > $HOME/codecov-bash.sh && chmod +x $HOME/codecov-bash.sh
1938
script:
20-
- ./gradlew checkstyleMain
21-
- ./gradlew checkstyleTest
22-
- travis_retry .utility/travis-run-tests.sh
39+
- build/setMavenVersion.sh
40+
- mvn verify -fae -DskipITs $MVN_ARGS
2341
after_success:
24-
- bash <(curl -s https://codecov.io/bash)+++++++
42+
- build/publishCodeCoverage.sh
2543

26-
- stage: Semantic release
27-
jdk: openjdk8
28-
language: java
29-
if: (branch = master OR branch = rc) AND type = push AND fork = false
30-
before_install:
31-
- pip install --user bumpversion
44+
- stage: Semantic-Release
45+
install:
46+
- sudo apt-get install python
3247
- nvm install 12
48+
- npm install -g npm@6.x
49+
- pip install --user bump2version
3350
- npm install @semantic-release/changelog
3451
- npm install @semantic-release/exec
3552
- npm install @semantic-release/git
53+
- npm install @semantic-release/github
3654
script:
3755
- npx semantic-release
56+
after_success:
57+
- echo "Semantic release has successfully created a new tagged-release"
3858

39-
- stage: Publish javadoc
59+
- stage: Publish-Release
4060
jdk: openjdk8
41-
language: java
42-
if: type = push AND fork = false
61+
name: Publish-Javadoc
62+
install: true
4363
script:
44-
- ./gradlew docs
45-
- .utility/push-javadoc-to-gh-pages.sh
64+
- build/setMavenVersion.sh
65+
- mvn clean javadoc:aggregate $MVN_ARGS
66+
- build/publishJavadoc.sh
67+
after_success:
68+
- echo "Javadocs successfully published to gh-pages!"
4669

47-
- stage: Upload Archives
48-
jdk: openjdk8
49-
language: java
50-
if: tag IS present
70+
- jdk: openjdk8
71+
name: Publish-To-Maven-Central
72+
install: true
5173
script:
52-
- .utility/deploy-travis-wrapper.sh
53-
54-
notifications:
55-
email: true
74+
- build/setupSigning.sh
75+
- build/setMavenVersion.sh
76+
- mvn deploy $MVN_ARGS -DskipTests -P central
77+
after_success:
78+
- echo "Maven artifacts successfully published to Maven Central!"

.utility/bintray-properties.gradle

Lines changed: 0 additions & 8 deletions
This file was deleted.

.utility/bintray-release.gradle

Lines changed: 0 additions & 62 deletions
This file was deleted.

.utility/bumpversion.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

.utility/decrypt-service-instance-apikeys.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

.utility/deploy-travis-wrapper.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

.utility/patch-openjdk7.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)