I wrote a test program to get familar with maven:
package com.mycompany.app;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
public class App
{
public static void main( String[] args )
{
List<String> someList = new ArrayList<String>();
CollectionUtils.addAll(someList, new String[]{ "Hello ", "World"});
System.out.println( someList.get(0)+someList.get(1) );
}
}
And I added the commons-collections dependency to the pom.xml:
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
I was able to compile it with
mvn clean package
How do I execute it? I could find me the correct version of the commons-collection library and could run it by explicit mentioning it at the start, but at least the finding the correct version is job of maven.
If I want to give it to someone who doesn't has maven, what do I do?
I would expect there is a command that collects all dependent jars and put it in a folder.