Making a runnable .jar with dependent libraries for dummys..
Can someone outline the steps I have to take to making a runnable .jar with dependent libraries for dummy with Maven and Eclipse.
I want to use Maven to load the dependent jars but will be using eclipse to do all my coding.... can this be done? I started a projects but Eclipses does not see the dependent libs in my pom.xml file so I am getting errors as I am coding.
Here is my pom.xml
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.runnablejar</groupId>
<artifactId>RunnableJAR</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>RunnableJAR</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>fully.qualified.MainClass</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
and I dont know why this code is giving me errors in eclipses
package org.runnablejar.RunnableJAR;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Hello world!
*
*/
public class App
{
private static Log log = LogFactory.getLog(App.class.getName());
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}