There is a kludge you could possibly use.  Of course I am feeding bad 
behaviors...  but what the heck, its an official codehaus plugin - it would be 
wrong not to mention it.

http://mojo.codehaus.org/properties-maven-plugin/ 

have your ant task write to a file instead of exporting the property, then have 
this plugin read it in.  You could repeat the plugin invocation in your child 
modules.


________________________________________
From: Stephen Connolly [[email protected]]
Sent: Tuesday, March 12, 2013 5:45 AM
To: Maven Users List
Subject: Re: maven-antrun-plugin in interactive mode

Please read my answer to a similar question on stack overflow:
http://stackoverflow.com/questions/14725197/reading-properties-file-from-pom-file-in-maven/14727072#14727072

When you use antrun to set properties, you are setting "Mojo injected
properties" to use the terminology of my answer. Such properties are only
available within the scope of the currently executing module and only after
the execution of the injecting mojo. Those properties are not available to
child modules. If you look at the reactor order in the build plan, you will
also probably see that the module you are executing this in is running
after the child modules, so even if you could "trick" maven to make this
available to the child modules, it would be too late in any case


On 12 March 2013 10:24, virg g <[email protected]> wrote:

> Hi,
> I am using maven-antrun-plugin 1.8 in interactive mode to accept user
> inputs for build version for my project.  i want to use this version to be
> updated in all manifests file of all the jars of my project creates.
> I have added this plugin in the parent pom, which has all the modules to be
> built and also the plugin for jar to add manifest info. But the input
> received from prompt i.e build version, not able to update the manifest
> info from this variable (build version). I getting this value as empty. How
> to make this value available to all the jars while updating manifest info.
> This is my sample code in the parent POM. I dont want to pass these
> parameters as command line arguments which i am able to update manifest
> info. My option is only interactive mode. I have set
> <inherited>false</inherited> without this, it prompts for each jar which
> when it creates. Any help is highly appreciated.
>                                         <plugin>
>                         <groupId>org.apache.maven.plugins</groupId>
>                         <artifactId>maven-antrun-plugin</artifactId>
>                         <version>1.7</version>
>                         <executions>
>                             <execution>
>                                 <id>catch-new-version</id>
>                                 <inherited>false</inherited>
>                                 <goals>
>                                     <goal>run</goal>
>                                 </goals>
>                                 <phase>validate</phase>
>                                 <configuration>
>                                     <target>
>
>                                         <input
>                                         message="Please enter the new build
> version : "
>                                         addproperty=build-version" />
>                                     </target>
>
> <exportAntProperties>true</exportAntProperties>
>                                 </configuration>
>                             </execution>
>                                                    </executions>
>                                                </plugin>
>
>                                             <plugin>
>                         <groupId>org.apache.maven.plugins</groupId>
>                         <artifactId>maven-jar-plugin</artifactId>
>                         <version>2.3.1</version>
>
> -------------------------------
>                                                 <archive>
>                                 <manifestEntries>
>
> <Release-Test-Label>${build-version}</Release-Test-Label>
>                                 </manifestEntries>
>                             </archive>
>                                                 </plugin>
>
> Thanks
> virg
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to