Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

minor modifications

* add maven-assembly-plugin configuration to pom.xml so it can be built
  with "mvn package"

* changed <dependency> stanza so it will add locally deployed *.jar if no
  match is found

* add build instructions to the README
  • Loading branch information...
commit 3f44a3689c682ffbb57f186eefe2534fab62d21f 1 parent f076e9e
Michal Stekrt maiklos authored
11 README.markdown
View
@@ -12,8 +12,15 @@ hash to search a REST API for the Maven coordinates of the given artifact.
For each identified jar file, it will print out a snippet of XML that you can include
in the dependencies section of your pom.xml
+Build:
+------
+ in the directory where is pom.xml run:
+ mvn package
+
+ then copy the final jar whenever you want:
+ cp target/provenance-1.1-jar-with-dependencies.jar somewhere/provenance.jar
+
Run like:
---------
-
- $ java Provenance lib_dir
+ $ java -jar Provenance.jar lib_dir
50 pom.xml
View
@@ -1,12 +1,46 @@
<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>
- <groupId>com.armhold</groupId>
- <artifactId>provenance</artifactId>
- <version>1.0</version>
- <name>Provenance</name>
- <url>http://github.com/armhold</url>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.armhold</groupId>
+ <artifactId>provenance</artifactId>
+ <version>1.1</version>
+ <name>Provenance</name>
+ <url>http://github.com/armhold</url>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <appendAssemblyId>true</appendAssemblyId>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <mainClass>com.armhold.Provenance</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+
+ </build>
</project>
6 src/main/java/com/armhold/Provenance.java
View
@@ -121,7 +121,11 @@ public void importJarFiles(String dir)
if (xml == null)
{
- xml = "<dependency>\n <groupId>unknown</groupId>\n <artifactId>" + file.getName() + "</artifactId>\n <version>unknown</version>\n</dependency>";
+ //xml = "<dependency>\n <groupId>unknown</groupId>\n <artifactId>" + file.getName() + "</artifactId>\n <version>unknown</version>\n</dependency>";
+ xml = "<dependency>\n <groupId>unknown</groupId>\n <artifactId>" + file.getName().split("\\.")[0] + "</artifactId>\n <version>1.0</version>\n <scope>system</scope>\n " +
+ " <systemPath>${project.basedir}/lib/"+file.getName()+"</systemPath>\n</dependency>";
+
+
}
StringBuilder b = new StringBuilder();
Please sign in to comment.
Something went wrong with that request. Please try again.