我以下面的方式使用maven-assumbly-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
<!-- necessary in order to avoid
`Error reading assemblies: No assembly
descriptors found.` -->
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>并注意到,在打包大型依赖项时,它的速度非常慢,比如具有多个100MB的斯坦福CoreNLP模型。这是一种罕见的用例,但我假设并行实现是可用的,因为多核处理器已经存在了几十年。怎么用?
发布于 2020-04-27 11:23:08
Maven 3.x具有执行并行构建的能力。命令如下:
mvn -T 4 clean install # Builds with 4 threads
mvn -T 1C clean install # 1 thread per cpu core
mvn -T 1.5C clean install # 1.5 thread per cpu corehttps://stackoverflow.com/questions/45148408
复制相似问题