【发布时间】:2011-07-14 13:39:57
【问题描述】:
我已将maven-license-plugin 添加到我在Eclipse 中设置的maven 项目中。现在它已配置,我无法找到执行它的方法。谁能向我解释一下你是如何在 eclipse 中运行它的?谢谢。
pom.xml 文件。
<plugin>
<groupId>com.google.code.maven-license-plugin</groupId>
<artifactId>maven-license-plugin</artifactId>
<version>1.4.0</version>
<configuration>
<header>header.txt</header>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
右键单击项目,运行方式显示 Maven assembly/build/clean/install/package/generate-sources/test/jar 的选项——我没有任何其他选项。
已尝试:
设置一个外部工具,我设置为${maven_exec}(在首选项中配置为mvn.bat的字符串替换),参数为license:format -Dyear=2011 -Demail=myaddress@mycompany.com
结果:
Buildfile: C:\dev\dependencies\maven\bin\mvn.bat
BUILD FAILED
C:\dev\dependencies\maven\bin\mvn.bat:1: Content is not allowed in prolog.
【问题讨论】:
-
为什么在 Eclipse 中需要它?您不是出于分发目的从命令行构建应用程序吗?
-
"prolog 中不允许有内容。"通常是一个 XML 解析器错误,表明文件开头有一些无效的 XML。你的 pom 还好吗?
-
@Thomas,deloyed 的人工制品是由 Hudson 建造的。我想确保所有文件都已获得许可,这使我能够以一种集中的方式来确保每个文件都具有正确、最新的许可信息——尽管仍然无法正常工作:)
-
@Matthew,谢谢,但无法找到解决问题的方法。它会是插件。
-
所以你说,从 hudson 运行插件也不起作用?您是否设置了 hudson 来调用
check目标?
标签: java eclipse-plugin maven-plugin