Skip to content

Add simple Maven Plugin#49

Merged
bjhargrave merged 1 commit into
eclipse-transformer:masterfrom
jgallimore:mojo
Jun 18, 2020
Merged

Add simple Maven Plugin#49
bjhargrave merged 1 commit into
eclipse-transformer:masterfrom
jgallimore:mojo

Conversation

@jgallimore
Copy link
Copy Markdown
Contributor

We discussed this a bit on the old repository, so here it is, rebased against the new Maven build. See tbitonti/jakartaee-prototype#102.

The Mojo provides a classifier parameter, and any attached artifacts get transformed, and the transformed artifacts are attached with whatever value is specified appended to the artifacts classifier.

For example, in the TomEE build we have the following plugin config:

      <plugin>
        <groupId>org.eclipse.transformer</groupId>
        <artifactId>org.eclipse.transformer.mave
        <version>0.1.1-SNAPSHOT</version>
        <configuration>
          <classifier>jakartaee9</classifier>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>package</phase>
          </execution>
        </executions>
      </plugin>

And the module has the following attached artifacts:

org.apache.tomee:apache-tomee:webprofile:8.0.3-SNAPSHOT:zip
org.apache.tomee:apache-tomee:microprofile:8.0.3-SNAPSHOT:zip
org.apache.tomee:apache-tomee:plume:8.0.3-SNAPSHOT:zip
org.apache.tomee:apache-tomee:plus:8.0.3-SNAPSHOT:zip

Once the plugin is run, the following additional artifacts are attached:

org.apache.tomee:apache-tomee:webprofile-jakartaee9:8.0.3-SNAPSHOT:zip
org.apache.tomee:apache-tomee:microprofile-jakartaee9:8.0.3-SNAPSHOT:zip
org.apache.tomee:apache-tomee:plume-jakartaee9:8.0.3-SNAPSHOT:zip
org.apache.tomee:apache-tomee:plus-jakartaee9:8.0.3-SNAPSHOT:zip

@jgallimore
Copy link
Copy Markdown
Contributor Author

This relates to issue #48.

Comment thread org.eclipse.transformer.maven/pom.xml
this.project = project;
}

public MavenSession getSession() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is a lot of boiler plate getters and setters which are not really used in the mojo. Some the them seem to be for testing, but we can get away with default visibility (non-public) for them.

Also, no one seems to even use session.

Comment thread org.eclipse.transformer.maven/pom.xml Outdated
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should put all the dependency version management into the parent pom's pluginManagement section so we have everything nicely centralized.

Comment thread org.eclipse.transformer.maven/pom.xml Outdated
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-api</artifactId>
<version>1.2.6</version>
<scope>compile</scope>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is just a test dependency, right?

Comment thread org.eclipse.transformer.maven/pom.xml Outdated
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We already set the version in the parent pom's pluginManagement.

Comment thread org.eclipse.transformer.maven/pom.xml Outdated
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we need this plugin.

@bjhargrave bjhargrave linked an issue Jun 15, 2020 that may be closed by this pull request
@jgallimore
Copy link
Copy Markdown
Contributor Author

I'll recheck in the morning, but I think I have managed to address all the feedback. Thanks for the review!

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

It looks like the feedback here is addressed. I've rebased and resolved the conflicts. Would it be possible for someone to have another look?

Copy link
Copy Markdown
Contributor

@bjhargrave bjhargrave left a comment

Choose a reason for hiding this comment

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

LGTM

@bjhargrave bjhargrave merged commit b48f7cd into eclipse-transformer:master Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transformer Maven Plugin

2 participants