猜猜你dozer-package
有依赖slf4j
,对吧?
然后你应该检查这个 Maven-Plugin:Maven-Assembly-Plugin
这会将您所需的依赖项放入 jar 中。
在这里你可以阅读,如何使用它
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
version>2.4</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>your.main.class</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
如果您希望在调用时始终执行 assemby-plugin,请将mvn clean package
其添加到您的 maven-assembly-plugin:
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>