Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
插件执行时的Maven属性_Maven_Maven 3_Maven Plugin - Fatal编程技术网

插件执行时的Maven属性

插件执行时的Maven属性,maven,maven-3,maven-plugin,Maven,Maven 3,Maven Plugin,我试图弄清楚如何在生命周期的不同点将maven属性设置为不同的值。例如,如果在项目级别设置属性 <project> <properties> <some.property>Value</some.property> </properties> </project> 有什么想法吗?使用配置文件是一个选项(每个配置文件都有它的requirejsplugin执行): 概要-1 价值1 ... 剖

我试图弄清楚如何在生命周期的不同点将maven属性设置为不同的值。例如,如果在项目级别设置属性

<project>
    <properties>
        <some.property>Value</some.property>
    </properties>
</project>

有什么想法吗?

使用配置文件是一个选项(每个配置文件都有它的requirejsplugin执行):


概要-1
价值1
...
剖面-2
价值2
...
使用
-p
激活所需的配置文件(但如果激活2个或更多,请小心)


完整文档。

感谢您提供的信息,这似乎是一个选项,但是如果我激活2个或更多,配置文件是按顺序执行的,还是按-p或变量步骤执行的?我会说按顺序,但您可能想验证一下。您解决了这个问题吗?我有一个类似的问题,我也有这个问题,你解决了吗?@HavenLin我没有,我已经从Maven和Java开始,所以我不记得我是否找到了解决方案。我可以获得一些像${plugin.id}这样属性的信息,但也无法访问执行id。
<plugins>
    <plugin>
        <groupId>com.github.mcheely</groupId>
        <artifactId>requirejs-maven-plugin</artifactId>
        <version>2.0.0</version>
        <executions>
           <execution>
                <!-- change the value here -->
           </execution>
           <execution>
                <!-- change the value here again-->
           </execution>
        </executions>
    </plugin>
</plugins>
<plugins>
    <plugin>
        <groupId>com.github.mcheely</groupId>
        <artifactId>requirejs-maven-plugin</artifactId>
        <version>2.0.0</version>
        <executions>
           <execution>
               <id>SomeID</id>
               <!-- change the value here -->
           </execution>
           <execution>
               <id>SomeID</id>
               <!-- change the value here again-->
           </execution>
        </executions>
    </plugin>
</plugins>
${execution.id}
<profiles>
  <profile>
    <id>profile-1</id>
    <properties>
        <some.property>Value1</some.property>
    </properties>
    ...
  </profile>
  <profile>
    <id>profile-2</id>
    <properties>
        <some.property>Value2</some.property>
    </properties>
    ...
  </profile>
</profiles>