diff --git a/README.md b/README.md index bb2b071..7e836c1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ To use the plugin you need to configure it in your `pom.xml` like so de.jutzig github-release-plugin - 1.1.1 + 1.5.0 Description of your release 1.0 Final @@ -35,11 +35,12 @@ To use the plugin you need to configure it in your `pom.xml` like so Unless otherwise specified, the plugin will upload the main artifact of your project and take the github repository url from the `` section. -By default, the plugin will look for your github credentials in your maven `settings.xml`. Example +By default, the plugin will look for your github credentials in your maven `settings.xml`. Credentials can be privated as an API token, or username and password. Example ``` github + API_TOKEN GITHUB_USERNAME GITHUB_PASSWORD @@ -48,12 +49,13 @@ By default, the plugin will look for your github credentials in your maven `sett These credentials can be overridden by setting `username` and `password` as system properties. -Thanks to a contribution from rowanseymour you can also use your API token by adding it as `` to your server definition in the `settings.xml`. - Additional Parameters: * `-Dgithub.draft=true` creates the release in draft state * `-Dgithub.commitish=release/1.0.0` allows to specify a commitsh + * `-Dgithub.apitoken=API_TOKEN` allows to set github api token instead of providing it in settings.xml + * `-Dgithub.username=GITHUB_USERNAME` allows to set github username instead of providing it in settings.xml + * `-Dgithub.password=GITHUB_PASSWORD` allows to set github password instead of providing it in settings.xml The plugin is available on Maven central diff --git a/pom.xml b/pom.xml index dfb6bda..7f3e852 100644 --- a/pom.xml +++ b/pom.xml @@ -55,6 +55,11 @@ + + org.apache.maven.plugins + maven-plugin-plugin + 3.6.4 + org.apache.maven.plugins maven-javadoc-plugin @@ -83,8 +88,9 @@ install run - - package + + none + diff --git a/src/it/test-multi-module/pom.xml b/src/it/test-multi-module/pom.xml index d3dde1d..7988c6b 100644 --- a/src/it/test-multi-module/pom.xml +++ b/src/it/test-multi-module/pom.xml @@ -14,6 +14,12 @@ master + + 1.8 + 1.8 + + + child1 child2 diff --git a/src/it/test-release/pom.xml b/src/it/test-release/pom.xml index 0ac0c6b..825fd56 100644 --- a/src/it/test-release/pom.xml +++ b/src/it/test-release/pom.xml @@ -22,6 +22,11 @@ master + + 1.8 + 1.8 + + diff --git a/src/main/java/de/jutzig/github/release/plugin/UploadMojo.java b/src/main/java/de/jutzig/github/release/plugin/UploadMojo.java index 6ecf54f..65decf0 100644 --- a/src/main/java/de/jutzig/github/release/plugin/UploadMojo.java +++ b/src/main/java/de/jutzig/github/release/plugin/UploadMojo.java @@ -344,9 +344,9 @@ public GitHub createGithub(String serverId) throws MojoExecutionException, IOExc throw new MojoExecutionException("Unable to lookup SettingsDecrypter: " + cle.getMessage(), cle); } - String serverUsername = server.getUsername(); - String serverPassword = server.getPassword(); - String serverAccessToken = server.getPrivateKey(); + String serverUsername = System.getProperty("github.username", server.getUsername()); + String serverPassword = System.getProperty("github.password", server.getPassword()); + String serverAccessToken = System.getProperty("github.apitoken", server.getPrivateKey()); if (StringUtils.isNotEmpty(serverUsername) && StringUtils.isNotEmpty(serverPassword)) return gitHubBuilder.withPassword(serverUsername, serverPassword).build(); else if (StringUtils.isNotEmpty(serverAccessToken))