Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

Add a basic Maven plugin to run the Transformer #102

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jgallimore
Copy link
Contributor

@jgallimore jgallimore commented Apr 20, 2020

This will likely need some rework and tweaking, but thought I'd open this, and push further commits to it as necessary. This PR provides a basic Maven plugin. To use it, you'll need to at least push it to your local Maven repository on your machine, which you can achieve by running

./gradlew -i build
./gradlew -i publishToMavenLocal

To test is with a simple Maven project that builds a .war file, on your Maven project, you can run something like this:

mvn clean install org.eclipse.transformer:transformer-maven-plugin:0.1.0-SNAPSHOT:run

and you should see the Transformer run after the .war file is created:

[INFO] 
[INFO] --- maven-war-plugin:3.1.0:war (default-war) @ moviefun ---
[INFO] Packaging webapp
[INFO] Assembling webapp [moviefun] in [/home/jgallimore/dev/tomee/examples/moviefun/target/moviefun]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/jgallimore/dev/tomee/examples/moviefun/src/main/webapp]
[INFO] Webapp assembled in [32 msecs]
[INFO] Building war: /home/jgallimore/dev/tomee/examples/moviefun/target/moviefun.war
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ moviefun ---
[INFO] Installing /home/jgallimore/dev/tomee/examples/moviefun/target/moviefun.war to /home/jgallimore/.m2/repository/org/superbiz/moviefun/8.0.2-SNAPSHOT/moviefun-8.0.2-SNAPSHOT.war
[INFO] Installing /home/jgallimore/dev/tomee/examples/moviefun/pom.xml to /home/jgallimore/.m2/repository/org/superbiz/moviefun/8.0.2-SNAPSHOT/moviefun-8.0.2-SNAPSHOT.pom
[INFO] 
[INFO] --- transformer-maven-plugin:0.1.0-SNAPSHOT:run (default-cli) @ moviefun ---
Logger name [ Transformer ] (Defaulted)
Log file [ null ]
[INFO] Input     [ /home/jgallimore/dev/tomee/examples/moviefun/target/moviefun.war ]
[INFO]           [ /home/jgallimore/dev/tomee/examples/moviefun/target/moviefun.war ]
[INFO] Output    [ /home/jgallimore/dev/tomee/examples/moviefun/target/output_moviefun.war ] (Generated from input)
[INFO]           [ /home/jgallimore/dev/tomee/examples/moviefun/target/output_moviefun.war ]
[INFO] Skipping option [ RULES_SELECTIONS ]
[INFO] Internal [ RULES_RENAMES ] URL [ jar:file:/home/jgallimore/.m2/repository/org/eclipse/transformer/transformer/0.1.0-SNAPSHOT/transformer-0.1.0-SNAPSHOT.jar!/com/ibm/ws/jakarta/transformer/jakarta-renames.properties ]
[INFO] Internal [ RULES_VERSIONS ] URL [ jar:file:/home/jgallimore/.m2/repository/org/eclipse/transformer/transformer/0.1.0-SNAPSHOT/transformer-0.1.0-SNAPSHOT.jar!/com/ibm/ws/jakarta/transformer/jakarta-versions.properties ]
[INFO] Internal [ RULES_BUNDLES ] URL [ jar:file:/home/jgallimore/.m2/repository/org/eclipse/transformer/transformer/0.1.0-SNAPSHOT/transformer-0.1.0-SNAPSHOT.jar!/com/ibm/ws/jakarta/transformer/jakarta-bundles.properties ]
[INFO] Internal [ RULES_DIRECT ] URL [ jar:file:/home/jgallimore/.m2/repository/org/eclipse/transformer/transformer/0.1.0-SNAPSHOT/transformer-0.1.0-SNAPSHOT.jar!/com/ibm/ws/jakarta/transformer/jakarta-direct.properties ]
[INFO] Internal [ RULES_MASTER_XML ] URL [ jar:file:/home/jgallimore/.m2/repository/org/eclipse/transformer/transformer/0.1.0-SNAPSHOT/transformer-0.1.0-SNAPSHOT.jar!/com/ibm/ws/jakarta/transformer/jakarta-xml.properties ]
[INFO] All resources will be selected
[INFO] Package renames are in use
[INFO] Package versions will be updated
[INFO] Bundle identities will be updated
[INFO] Internal [ Substitions matching [ server.xml ] ] URL [ jar:file:/home/jgallimore/.m2/repository/org/eclipse/transformer/transformer/0.1.0-SNAPSHOT/transformer-0.1.0-SNAPSHOT.jar!/com/ibm/ws/jakarta/transformer/jakarta-xml-server.properties ]
[INFO] Internal [ Substitions matching [ *.xml ] ] URL [ jar:file:/home/jgallimore/.m2/repository/org/eclipse/transformer/transformer/0.1.0-SNAPSHOT/transformer-0.1.0-SNAPSHOT.jar!/com/ibm/ws/jakarta/transformer/jakarta-xml-all.properties ]
[INFO] Internal [ Substitions matching [ web.xml ] ] URL [ jar:file:/home/jgallimore/.m2/repository/org/eclipse/transformer/transformer/0.1.0-SNAPSHOT/transformer-0.1.0-SNAPSHOT.jar!/com/ibm/ws/jakarta/transformer/jakarta-xml-web.properties ]
[INFO] XML files will be updated
[INFO] Java direct string updates will not be performed
[INFO] Action selected for input [ /home/jgallimore/dev/tomee/examples/moviefun/target/moviefun.war ]: WAR Action
[INFO] Input [ /home/jgallimore/dev/tomee/examples/moviefun/target/moviefun.war ] as [ /home/jgallimore/dev/tomee/examples/moviefun/target/output_moviefun.war ]: Changed
[INFO] [          All Resources ] [     34 ] Unselected [      0 ] Selected [     34 ]
[INFO] [            All Actions ] [     34 ]  Unchanged [     31 ]  Changed [      3 ]
[INFO] [       Nested Resources ] [    148 ] Unselected [      0 ] Selected [    148 ]
[INFO] [         Nested Actions ] [    148 ]  Unchanged [    148 ]  Changed [      0 ]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  35.658 s
[INFO] Finished at: 2020-04-20T17:26:23+01:00
[INFO] ------------------------------------------------------------------------

I would very much appreciate any feedback on this. Many thanks!

jgallimore and others added 2 commits April 20, 2020 17:35
Signed-off-by: Jonathan Gallimore <jgallimore@tomitribe.com>
Added standard Eclipse / Apache copyright header.
Copy link
Owner

@tbitonti tbitonti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the standard copyright header to TransformMojo.java. Don't know if the build files need copyrights, so I left them alone.

@tbitonti tbitonti requested a review from bjhargrave May 11, 2020 20:23
@jgallimore
Copy link
Contributor Author

Is there anything that I need to do to get this merged? Not a problem at all if its just a matter of time. If I need to do anything, I'm happy to help.

Signed-off-by: Jonathan Gallimore <jgallimore@tomitribe.com>
@jgallimore
Copy link
Contributor Author

Hold off doing anything with this - there are currently some issues I'm trying to resolve, specifically with the reference to biz.aQute.bnd:biz.aQute.bnd.transform:5.1.0-SNAPSHOT artifact in the jfrog repository, and changes to where the rules files are.

@jgallimore jgallimore marked this pull request as draft May 21, 2020 15:38
…n is usuable. Fix issues where target filename not passed into the Transformer, and property file changes.

Signed-off-by: Jonathan Gallimore <jgallimore@tomitribe.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants