Skip to content

Commit

Permalink
Maven Artifactory plugin example update
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaNevelev committed Jan 17, 2018
1 parent 986d716 commit a4c223a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
12 changes: 10 additions & 2 deletions artifactory-maven-plugin-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions artifactory-maven-plugin-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<version>2.4.1</version>
<version>2.6.1</version>
<inherited>false</inherited>
<executions>
<execution>
Expand All @@ -65,8 +65,8 @@
</deployProperties>
<artifactory>
<includeEnvVars>true</includeEnvVars>
<envVarsExcludePatterns>*password*,*secret*,*key*,*token*,*passphrase*</envVarsExcludePatterns>
<timeoutSec>60</timeoutSec>
<propertiesFile>publish.properties</propertiesFile>
</artifactory>
<publisher>
<contextUrl>http://localhost:8081/artifactory</contextUrl>
Expand All @@ -78,7 +78,7 @@
</publisher>
<buildInfo>
<buildName>plugin-demo</buildName>
<buildNumber>1</buildNumber>
<buildNumber>${buildnumber}</buildNumber>
<buildUrl>http://build-url.org</buildUrl>
</buildInfo>
<licenses>
Expand Down
15 changes: 15 additions & 0 deletions artifactory-maven-plugin-example/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<settings>
<profiles>
<profile>
<id>artifactory-plugin-properties</id>
<properties>
<username>admin</username>
<password>password</password>
</properties>
</profile>
</profiles>

<activeProfiles>
<activeProfile>artifactory-plugin-properties</activeProfile>
</activeProfiles>
</settings>

0 comments on commit a4c223a

Please sign in to comment.