Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

properties-maven-plugin: The parameters 'files' for goal ... are missing

I'm using Maven 3.0.3. I'm trying to test reading properties from a properties file (this is part of a larger effort, I wanted to get this part right first). I have this in my pom.xml file ...

  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>maven-properties-plugin</artifactId>
    <version>1.0</version>
    <configuration>
      <files>
        <file>${basedir}/build.properties</file>
      </files>
    </configuration>
  </plugin>

But sadly, running "mvn properties:read-project-properties" fails with the error below. How do I need to reconfigure what I'm doing? - Dave

davea-mbp2:socialmediaproxy davea$ mvn properties:read-project-properties  
[INFO] Scanning for projects...
[WARNING] The POM for org.codehaus.mojo:maven-properties-plugin:jar:1.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:maven-properties-plugin:1.0: Plugin org.codehaus.mojo:maven-properties-plugin:1.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:maven-properties-plugin:jar:1.0
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building socialmediaproxy 0.1
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.codehaus.mojo:maven-properties-plugin:jar:1.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:maven-properties-plugin:1.0: Plugin org.codehaus.mojo:maven-properties-plugin:1.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:maven-properties-plugin:jar:1.0
[INFO] 
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (default-cli) @ socialmediaproxy ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.355s
[INFO] Finished at: Fri Apr 15 11:01:31 CDT 2011
[INFO] Final Memory: 11M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-properties (default-cli) on project socialmediaproxy: The parameters 'files' for goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-properties are missing or invalid -> [Help 1]
[ERROR] 
like image 608
Dave Avatar asked Oct 24 '22 14:10

Dave


2 Answers

I think you mixed up the plugin artifact setting. The correct artifact identifiers are

<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>

See: Plugin Homepage

like image 165
FrVaBe Avatar answered Oct 31 '22 18:10

FrVaBe


  1. Update to the current plugin version 1.0-alpha-2
  2. Make sure the build.properties file exists in the ${basedir}
  3. Either:
    • specify the goal when calling mvn with mvn properties:read-project-properties
    • Or add the goal to the pom.xml

Example pom.xml:

<build>
  <plugins>
  ...
  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>properties-maven-plugin</artifactId>
    <version>1.0-alpha-2</version>
    <executions>
      <execution>
        <phase>initialize</phase>
        <goals>
          <goal>read-project-properties</goal>
        </goals>
        <configuration>
          <files>
            <file>${basedir}/build.properties</file>
          </files>
        </configuration>
      </execution>
    </executions>
  </plugin>
  ...
  </plugins>
</build>
like image 35
bnjmn Avatar answered Oct 31 '22 18:10

bnjmn