Bug 475224 - Use pom properties in post-build tasks
Summary: Use pom properties in post-build tasks
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Releng (show other bugs)
Version: 4.6   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Releng-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-18 00:49 EDT by David Williams CLA
Modified: 2015-08-18 10:18 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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).