当我创建一个jar文件时,我想要适应我的依赖项.为此,我使用maven-assembly-plugin
如下:
<build>
...
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<finalName>${project.artifactId}-GUI</finalName>
<archive>
<manifest>
<mainClass>gui.MyMainClass</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<!-- <appendAssemblyId>false</appendAssemblyId>-->
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
这段代码工作正常,它可以完成预期的工作.但是,这会创建一个名为的新jar myjar-GUI-jar-with-dependencies.jar
.我想消除那个"jar-with-dependencies"的结局.有谁知道怎么做?
我已经使用了你可以在我的代码中看到的注释行,但是这会产生以下警告:我不知道如何解决它:
[WARNING] Configuration options: 'appendAssemblyId' is set to false, and 'classifier' is missing.
Instead of attaching the assembly file: [myJar-GUI].jar, it will become the file for main project artifact.
NOTE: If multiple descriptors or descriptor-formats are provided for this project, the value …
Run Code Online (Sandbox Code Playgroud) 我正在寻找scala-maven-plugin
有关Maven的帮助。我想生成我的Scaladoc,但是我遇到了一些问题。
实际上,我可以输入以下命令来创建我的Scaladoc:
mvn scala:doc
Run Code Online (Sandbox Code Playgroud)
现在的问题是,在生成Scaladoc时,我想添加一些选项,例如-no-link-warnings
。
有谁知道如何做到这一点?我找到了一种方法(下面的代码有效),但是我认为那不是我应该做的方法。
我的pom文件是:
mvn scala:doc
Run Code Online (Sandbox Code Playgroud)
编辑
用户Tunaki在第一个答复中建议了一种更好的方法,您可以在此处看到代码。