diff --git a/artifactory-maven-plugin-example/README.md b/artifactory-maven-plugin-example/README.md index 7b7bfca33..49f97faf9 100644 --- a/artifactory-maven-plugin-example/README.md +++ b/artifactory-maven-plugin-example/README.md @@ -9,9 +9,17 @@ This example is using the Maven Artifactory Plugin for artifacts and build-info To run this example, please do the following: * Edit the pom.xml file and set the value of the *contextUrl* with your Artifactory URL, as well as the other Artifactory properties. For more configuration information see the [Maven Artifactory Plugin documentation](https://www.jfrog.com/confluence/display/RTF/Maven+Artifactory+Plugin). -* CD to the project directory and run the following command (replace *admin* and *password* with your Artifactory credentials): +* CD to the project directory and run *mvn deploy*. + +You can define the Artifactory details inside the pom file using properties. These properties can be sent to maven as system properties: +```console +mvn deploy -Dusername=admin -Dpassword=password -Dbuildnumber=1 +``` + +Alternatively they can be defined in the settings xml as described [here](https://maven.apache.org/examples/injecting-properties-via-settings.html). + ```console -> mvn deploy -Dusername=admin -Dpassword=password +mvn deploy -Dbuildnumber=1 -s settings.xml ``` This would deploy the produced artifacts to the configured Artifactory server: diff --git a/artifactory-maven-plugin-example/pom.xml b/artifactory-maven-plugin-example/pom.xml index 1301fc9f1..550c59d03 100644 --- a/artifactory-maven-plugin-example/pom.xml +++ b/artifactory-maven-plugin-example/pom.xml @@ -51,7 +51,7 @@ org.jfrog.buildinfo artifactory-maven-plugin - 2.4.1 + 2.6.1 false @@ -65,8 +65,8 @@ true + *password*,*secret*,*key*,*token*,*passphrase* 60 - publish.properties http://localhost:8081/artifactory @@ -78,7 +78,7 @@ plugin-demo - 1 + ${buildnumber} http://build-url.org diff --git a/artifactory-maven-plugin-example/settings.xml b/artifactory-maven-plugin-example/settings.xml new file mode 100644 index 000000000..9359e0b09 --- /dev/null +++ b/artifactory-maven-plugin-example/settings.xml @@ -0,0 +1,15 @@ + + + + artifactory-plugin-properties + + admin + password + + + + + + artifactory-plugin-properties + + \ No newline at end of file