We have a bunch of jars we install into our repo and I see this question
a lot so I figured I'll throw my technique out there:
I create a folder (in a defined format so I can svn it) and make a quick
pom with the minimum (adding depends if I know them). Then I name the
jar the way it should be: artifactId-version. My pom calls the antrun
plugin to unzip the jar to the target/classes folder. This is so the
packaging phase can jar it up (and add a manifest), setting up the
references needed so install and or deploy will do their thing. This
works out very well for us since I now have a pom and deploy will create
all the hashes, etc. It's also very easy to type mvn deploy instead of
remembering the other parameterized method, and very reproducible. Since
the bulk of my pom (the entire build section) is identical from one jar
to the next, it is very quick to do another, maybe 60 seconds. Here is
what my pom looks like: (for this example I would put javamail-1.3.3.jar
in the root along with the pom)
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>javamail</groupId>
<artifactId>javamail</artifactId>
<name> Sun Mail API </name>
<version>1.3.3</version>
<description>Mail API for java - from Sun</description>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<tasks>
<unzip src="${maven.build.finalName}.${maven.packaging}"
dest="target/classes"></unzip>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
</extension>
</extensions>
</build>
<distributionManagement>
<repository>
<id>my repo</id>
<url>my repo</url>
</repository>
</distributionManagement>
</project>