相关疑难解决方法(0)

properties-maven-plugin:加载属性文件时出错

我想从我的pom.xml中提取属性文件中的所有属性.这些是常见的属性,如依赖版本,插件版本和目录.我正在使用properties-maven-plugin,但它不能像我想要的那样工作.

我的pom.xml的基本部分:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>properties-maven-plugin</artifactId>
  <version>1.0-alpha-1</version>
  <executions>
    <execution>
      <phase>initialize</phase>
      <goals>
        <goal>read-project-properties</goal>
      </goals>
      <configuration>
       <files>
          <file>${basedir}/pom.properties</file>
        </files>
      </configuration>
    </execution>
  </executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)

现在,当我运行"mvn属性:read-project-properties"时,我收到以下错误:

[INFO] One or more required plugin parameters are invalid/missing for 'properties:read-project-properties'

[0] Inside the definition for plugin 'properties-maven-plugin' specify the following:

<configuration>
  ...
  <files>VALUE</files>
</configuration>.
Run Code Online (Sandbox Code Playgroud)

pom.properties文件与pom.xml位于同一目录中.我该怎么做才能让properties-maven-plugin读取我的属性文件?

编辑

我在http://jira.codehaus.org/browse/MOJO-1523提交了一个问题.它已被关闭为"不是一个bug",原因是:

这是设计的.项目定义必须是自包含的,否则如果从别处作为传递deps的一部分引用它则不再完整.

maven-2 maven-plugin

9
推荐指数
2
解决办法
3万
查看次数

标签 统计

maven-2 ×1

maven-plugin ×1