OpnWorks Artifactory Maven plugin

A plugin that exposes the REST API of the Artifactory repository manager. A single goal is supported at this time: removeSnapshots

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.opnworks.maven
ArtifactId

ArtifactId

artifactory-maven-plugin
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

OpnWorks Artifactory Maven plugin
A plugin that exposes the REST API of the Artifactory repository manager. A single goal is supported at this time: removeSnapshots
Project Organization

Project Organization

Mirasol Op'nWorks
Source Code Management

Source Code Management

https://github.com/laurent-opnworks/artifactory-maven-plugin

Download artifactory-maven-plugin

How to add to project

<plugin>
    <groupId>com.opnworks.maven</groupId>
    <artifactId>artifactory-maven-plugin</artifactId>
    <version>1.0.1</version>
</plugin>

Dependencies

compile (7)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.0
org.apache.maven : maven-settings jar 3.0.4
org.apache.cxf : cxf-rt-frontend-jaxrs jar 2.7.4
ch.qos.logback : logback-classic jar 1.0.9
org.springframework : spring-beans jar 3.1.1.RELEASE
org.springframework : spring-context jar 3.1.1.RELEASE
org.codehaus.jettison : jettison jar 1.3.3

test (2)

Group / Artifact Type Version
junit : junit jar 4.8.2
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 2.1

Project Modules

There are no modules declared in this project.

artifactory-maven-plugin

This plugin can be used to delete snaphot versions of released artifacts.

For example, if foo-bar-1.0.0 was released/published to Artifactory then the plugin will delete the foo-bar-1.0.0-SNAPSHOT from the SNAPSHOTS repo.

Typically, one will use a job scheduler such as Jenkins or Hudson to periodically run the plugin.

Usage

mvn com.opnworks.maven:artifactory-maven-plugin:[VERSION]:removeSnapshots \
	-Dartifactory.serviceUrl=http[s]://[HOST]:[PORT]/[ARTIFACTORY_CONTEXT_ROOT] \
	-Dartifactory.snapshotsRepoKey=SNAPSHOTS_REPO \
	-Dartifactory.releasesRepoKey=RELEASES_REPO \
	-Dartifactory.serverId=SERVER_ID \
	-Dartifactory.dryRun=[true | false] \
	-Dartifactory.rootPath=MY/ROOT/PATH

Where:

	SERVER_ID : ID of <server> element in Maven settings.xml containing
				artifactory user credentials 

Example

mvn com.opnworks.maven:artifactory-maven-plugin:1.0.0:removeSnapshots \ 
	-Dartifactory.serviceUrl=http://repo.jfrog.org/artifactory \
	-Dartifactory.snapshotsRepoKey=libs-snapshots-local \
	-Dartifactory.releasesRepoKey=libs-releases-local \
	-Dartifactory.serverId=artifactory-jfrog \
	-Dartifactory.dryRun=true \
	-Dartifactory.rootPath=org/apache/maven

Sample Run

...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- artifactory-maven-plugin:0.0.4:removeSnapshots (default-cli) @ standalone-pom ---
2013-05-13_15:04:02.221 INFO  o.a.c.b.spring.BusApplicationContext - Loaded configuration file jar:file:/d:/repository/com/opnworks/maven/ar
tifactory-maven-plugin/0.0.4/artifactory-maven-plugin-0.0.4.jar!/client/client.xml.
2013-05-13 15:04:02 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]
2013-05-13 15:04:02 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from URL [jar:file:/d:/repository/com/opnworks/maven/artifactory-maven-plugin/0.0.4/artifactory-maven-plu
gin-0.0.4.jar!/client/client.xml]
2013-05-13 15:04:02 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12e5c94: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,storage.proxyFactory,storage]; root of factory hierarchy
[INFO] About to delete: http://MY_SERVER/artifactory/repo-snapshots/com/opnworks/maven/demo-app-foo/1.0.10-SNAPSHOT
[INFO] Deleted: com/opnworks/maven/demo-app-foo/1.0.10-SNAPSHOT = 204
[INFO] About to delete: http://MY_SERVER/artifactory/repo-snapshots/com/opnworks/maven/demo-app-bar/1.0.10-SNAPSHOT
[INFO] Deleted: com/opnworks/maven/demo-app-bar/1.0.10-SNAPSHOT = 204
2013-05-13 15:04:17 org.springframework.context.support.AbstractApplicationContext doCloseINFO: Closing org.apache.cxf.bus.spring.BusApplicationContext@1eb717e: startup date [Mon May 13 15:04:01 EDT 2013]; root of context hierarchy
2013-05-13 15:04:17 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12e5c94: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,storage.proxyFactory,storage]; root of factory hierarchy
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.141s
[INFO] Finished at: Mon May 13 15:04:17 EDT 2013
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------

Versions

Version
1.0.1