I am brand new to both java and to maven, so this is likely very simple.
If I follow the maven2 hello world
instructions here:
http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
everything works OK. If I then alter pom.xml
to bring in a dependency from a remote repository, the files for this dependency get stored in ~/.m2/repository/new-dependency/
.
Using the syntax in the hello world
instructions to run the application requires that I add the absolute path to the dependency to my classpath (either by setting the environment variable or via the command line switch):
java -cp target/my-app-1.0-SNAPSHOT.jar:/.../.m2/.../new-dependency.jar com.mycompany.app.App
This will obviously get unwieldy quickly :)
I suspect that this is not the usual way of running a java program and that I just need to read more about .jar files, but while I am doing so I would appreciate any tips on how to do this properly.
I am not using an IDE, btw. vim from the command line.
Thanks!
Mike.