need:
When packaging, type all dependent jars of the project, and then execute them directly on the command line
java -jar *.jar parm1 parm2 .....
accomplish:
step one:
Add maven-assembly-plugin to pom
<build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>foo.Test</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> </build>
Step 2:
mvn command line or eclipse configuration
shell:mvn install assembly:assembly eclipse:install assembly:assembly
After the packaging is complete, there will be a *.jar-with-dependencies.jar