»
November 03, 2009
»

Publishing Files as Maven Artifacts

Interwebs are filled with information how to install files in local maven repository — just type mvn install:install-file, add few parameters and done. But it took some time for me to find information how to publish (actually to deploy) file in own repository. So here it is:

Deploy file

mvn deploy:deploy-file \
  -Durl=scp://user@server.com/path/to/repository
  -Dfile=gwt-user.jar \
  -DgroupId=com.google.webtoolkit \
  -DartifactId=gwt-user \
  -Dversion=2.0.0-ms2 \
  -Dpackaging=jar \
  -DgeneratePom=true

Using uploaded artifacts

Just add repository in pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
  http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  
  <repositories>
    <repository>
      <id>amateurinmotion</id>
      <name>amateurinmotion m2 repository</name>
      <url>http://www.amateurinmotion.com/repository</url>
    </repository>
  </repositories>

</project>

More info

 
Internet Explorer 6
Are you serious?