maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Scholte" <rfscho...@apache.org>
Subject Re: Maven plugin dependency cannot use parent pom property
Date Sat, 10 Jan 2015 11:15:50 GMT
Hi,

This makes me wonder if the "right" parent is used, so please double check  
the groupId, artifactId and version.
If both parent and module are part of the same multi-module, be sure that  
the relativePath is correct (defaults to ../pom.xml)
You could also use "mvn  
org.apache.maven.plugins:maven-help-plugin:2.2:effective-pom" to verify  
that the property is really there with the expected value.
If this is all as expected, then it seems to be a bug.

thanks,
Robert

Op Sat, 10 Jan 2015 10:53:15 +0100 schreef Luke Gordon <gordysc@gmail.com>:

> I'm hitting a weird edge use case with Maven & curious why it's behaving
> the way it does.
>
> I'm defining a property in my parent project like so:
>
>   <properties>
>       <some.property.version>1.0.0.0</some.property.version>
>   </properties>
>
> Now, in a module, I set a version of a dependency for a plugin like so:
>
>   <build>
>       <plugins>
>           <plugin>
>               <groupId>org.apache.maven.plugins</groupId>
>               <artifactId>bob</artifactId>
>               <version>1.0.0.0</version>
>               <dependencies>
>                   <dependency>
>                       <groupId>org.example</groupId>
>                       <artifactId>example</artifactId>
>                       <version>${some.property.version}</artifactId>
>                   </dependency>
>               </dependencies>
>           </plugin>
>       </plugins>
>   </build>
>
> This causes Maven to spit out an error:
>
> [ERROR]
> 'build.plugins.plugin[org.apache.maven.plugins:bob].dependencies.dependency.version'
> for org.example:example:jar must be a valid version but is
> '${some.property.version}'. @ line 350, column 16
>
> What's bizarre to me is if I move the property being defined down into  
> the
> module itself, Maven compiles just fine. Is this a bug? Or are there
> restrictions of visibility to parent pom properties in a plugin for a
> module?  I've verified this occurs on each version I've tried so far:
> 3.0.5, 3.1.1, & 3.2.5
>
> Cheers,
>
> Luke Gordon
> gordysc@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message