0

我尝试使用这个 maven 插件为我的代码获取一个可执行文件,来自How can I create an executable JAR with dependencies using Maven? . 但是它最终出现错误无法执行目标 com.mycila:license-maven-plugin:3.0:check (check-license) on project rinsim-example: Execution check-license of goal com.mycila:license-maven-plugin :3.0:check failed: 无法读取头文件 LICENSE_HEADER。原因:在文件系统、类路径或 URL 中找不到资源 LICENSE_HEADER:无协议:LICENSE_HEADER -> [帮助 1]>

这是我的 Maven 文件的一部分:

<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<mainClass>com.github.rinde.rinsim.examples.project.DDRP</mainClass>
						</manifest>
					</archive>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
				</configuration>
				<executions>
					<execution>
						<id>make-my-jar-with-dependencies</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

谢谢你。

4

1 回答 1

0

您似乎复制了RinSim pom.xml的一部分,包括 license-maven-plugin?您可能应该删除 license-maven-plugin 插件执行,因为这是此错误消息的来源。这是 RinSim 中 license-maven-plugin 的定义:

<pluginExecution>
  <pluginExecutionFilter>
    <groupId>com.mycila</groupId>
    <artifactId>
        license-maven-plugin
    </artifactId>
    <versionRange>
        [2.11,)
    </versionRange>
    <goals>
        <goal>check</goal>
    </goals>
  </pluginExecutionFilter>
  <action>
    <ignore></ignore>
  </action>
</pluginExecution>

或者,您可以选择使用license-maven-plugin。此插件允许您在每个源文件上设置许可证头。

于 2017-05-02T08:13:23.680 回答