adminfaces / admin-template

JSF responsive admin template based on Bootstrap and AdminLTE
https://adminfaces.github.io/docs/latest/#admin_template
MIT License
209 stars 101 forks source link

Automate the release of javax & jakarta artifacts #216

Closed rmpestano closed 1 year ago

rmpestano commented 2 years ago
Issue Overview

We have 2 deliverables for admin-template, one is the main jar which is JakartaEE 9 compatible (jakarta package migration) and the other one is javax compatible jar which is the same jar released using a different maven classifier.

To generate the javax artifact we do the following:

  1. Copy all java files to the target folder by including them as build resources
  2. Replace jakarta by javax (default we're jakarta compatible)
  3. Delete the java files from target folder

This flow works locally by just invoking mvn clean install -Prelease and invoking mvn clean install -Pjavax -Prelease and we have both the main and the javax artifact in local maven repo.

The problem happens when releasing via github actions because we use mvn deploy which releases the artifacts from current work directory and then we end up both artifacts in maven central compiled against javax, see #215.

This happens because the second install command in the release script overrides the compiled classes against jakarta package.

Calling mvn deploy twice is not possible (AFAIK) as after the deployment process the release is closed. Maven deploy-file might be an option.

The workaround as of now is to release manually.

Find a way to release both artifacts to maven central.

Current Behaviour

Both jars are compiled against javax.

Expected Behaviour

The main jar should be JakartaEE compatible

Additional Information
rmpestano commented 1 year ago

javax support as dropped #219