Search
Calendar
August 2017
S M T W T F S
« Sep    
 12345
6789101112
13141516171819
20212223242526
2728293031  
Your widget title
Archives

Posts Tagged ‘properties-maven-plugin’

PostHeaderIcon Maven 3 / properties-maven-plugin

Case

Maven 3 is stricter than Maven 2 on pom.xml compliancy with Maven’s XSD.
This induces more errors when a project is upgraded from Maven 2 to Maven 3.

For instance, I had the following block in my pom.xml:

			<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>conf/deployment/${maven.user}.pom.properties</file>
							</files>
						</configuration>
					</execution>
				</executions>
			</plugin>

I got this errors, related to properties-maven-plugin:

Failed to execute goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-properties (default-cli) on project jonathan-lalou-web: The parameters 'files' for goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-properties are missing or invalid -> [Help 1]

Initially, I thought the propery maven.user was not dynamically set. This is why I wrote the actual path in hard. But I got that error:

The parameters 'files' for goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-properties are missing or invalid

Quick Fix

As a quick fix, I made the block a little lighter:

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
                                <artifactId>properties-maven-plugin</artifactId>
                                <version>1.0-alpha-2</version>
                                <configuration>
                                    <files><file>conf/deployment/jlalou.pom.properties</file></files>
                                </configuration>
			</plugin>

This is a quick and dirty fix:

  1. I cannot configure the execution and restrict the plugin use to a single phase, as it was
  2. I have to run explicitly the goal. I mean: before, I ran mvn package weblogic:deploy, and now I have to run mvn org.codehaus.mojo:properties-maven-plugin:read-project-properties package com.oracle.weblogic:weblogic-maven-plugin:deploy (since I have upgraded Weblogic plugin at the same time)