Bug 475224

Summary: Use pom properties in post-build tasks
Product: [Eclipse Project] Platform Reporter: David Williams <david_williams>
Component: RelengAssignee: Platform-Releng-Inbox <platform-releng-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: mikael.barbero
Version: 4.6   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description David Williams CLA 2015-08-18 00:49:00 EDT
In bug 475146 changes were made so API Analysis reports were created by the API-tools from the most recent "eclipserun-repo". 

But, this actually required "hard coding" the URL to that repo in the ant file that's used to do it. It should be easy to "pass in" the variables set in the parent pom, and then use those. This has the advantage of coding values just once, but, plus, other "variables" in the "post build" tasks could be done the same way, so there is central spot of "documenting" what is variable. 

(Plus, eventually, all the post build tasks should be "moved into" the main build anyway ... just as a final step ... somewhere. I think there is already a bug open for that (opened long long ago).
Comment 1 Mikaƫl Barbero CLA 2015-08-18 04:15:56 EDT
The maven resource plugin could just do that. It is called resource filtering. You have to create a properties file template that you put somewhere in a maven module X (say at the root of this module with name api-analysis.properties). It will looks like this:

api-analysis.properties:

myProperty=${aMavenPropery}

and in the pom of the module X, you just have to specify

<build>
    <resources>
      <resource>
        <directory>.</directory>
        <filtering>true</filtering>
        <includes>
          <include>api-analysis.properties</include>
        </includes>
      </resource>
    </resources>
<build>

After X has been built, you will have a file target/api-analysis.properties with all variables ${} replaced with their values during the build. This file can then be loaded into your ant script.

HTH
Comment 2 David Williams CLA 2015-08-18 10:18:50 EDT
Well .... I think I'd just continue to use the "maven.properties" file we already produce ... see the 'save' directory, next to parent pom. (Just to document it).