问题标签 [maven-mojo]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - 为什么 MavenProject.addCompileSourceRoot() 没有按预期工作?
我有一个具有以下配置的自定义插件,但我不明白为什么该outputDir
文件夹没有添加到运行目标的项目的类路径中generate-sources
。
魔精类
插件 pom.xml
使用插件的项目 pom.xml
在 Eclipse 中运行 maven > run as > generate-sources 之后。文件夹${project.build.directory}/generated-sources/code
尚未添加到类路径中。
build-helper-maven-plugin有效,但我想避免使用它。
java - 无法从自定义 maven MOJO 获取系统参数
我尝试在自定义 maven MOJO 中获取系统属性的值,如下所述:https ://maven.apache.org/developers/mojo-api-specification.html 。我尝试从以下命令行获取值的属性是“releaseVersion”:
mvn -DdevelopmentVersion=0.0.0.7-SNAPSHOT -DreleaseVersion=0.0.0.6 -Dresume=false release:clean release:prepare release:perform
在我的自定义 MOJO 中,我尝试使用以下代码将系统属性注入到属性中:
我的 pom.xml 包含这个来启动我的 MOJO :
但在执行时,我收到以下错误:
[ERROR] Failed to execute goal plugin:my-release-maven-plugin:0.0.5:release-change (default-cli) on project exemple: The parameters 'releaseVersion' for goal fr.my.plugin:my-release-maven-plugin:0.0.5:release-change are missing or invalid -> [Help 1]
你知道为什么系统属性没有注入我的 MOJO 吗?