Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weblogic Maven Plugin version references in pom.xml is not updated on running weblogic openrewrite #14

Closed
gnsuryan opened this issue Dec 4, 2024 · 6 comments · Fixed by #22
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@gnsuryan
Copy link
Member

gnsuryan commented Dec 4, 2024

Weblogic Maven Plugin version references in pom.xml is not updated on running weblogic openrewrite

During migration of WebLogic maven plugin based applications from old versions of WebLogic (122140, 141100) to 141200 using
WebLogic openrewrite, the WebLogic maven plugin versions are not updated. They remain the same as it was earlier.

To reproduce the issue, follow the below steps:

Pre-requisites:

JDK17/21
Maven 3.9.8 or above

git clone https://github.com/dveselka/WebLogic.git to a directory, say /scratch/$USER/openrewrite-testing/

cd /scratch/$USER/openrewrite-testing/WebLogic/dave-basic-project/dave-basic-webapp-project/

Open pom.xml and verify the WebLogic maven Plugin version. It should be 14.1.1.0.0

Now run open-rewrite command to migrate to 141200 JDK17/21 using below commands:

For JDK17
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run
-Drewrite.recipeArtifactCoordinates=com.oracle.WebLogic.rewrite:rewrite-WebLogic:0.3.0
-Drewrite.activeRecipes=com.oracle.WebLogic.rewrite.UpgradeTo1412,org.openrewrite.java.migrate.UpgradeToJava17

For JDK21
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run
-Drewrite.recipeArtifactCoordinates=com.oracle.WebLogic.rewrite:rewrite-WebLogic:0.3.0
-Drewrite.activeRecipes=com.oracle.WebLogic.rewrite.UpgradeTo1412,org.openrewrite.java.migrate.UpgradeToJava21

Verify the changes in pom.xml. You can notice that pom.xml has got modified with changes in
JDK version, maven war plugin version etc. But the WebLogic Maven Plugin version remains the same

The expectation is that after migration, the WebLogic Maven Plugin version has to be modified accordingly.
In this case, the WebLogic Maven Plugin has to be updated to 14.1.2.0.0 from 14.1.1.0.0

@david-cabelus-oracle
Copy link
Member

@junior - any updates on this issue?

@junior junior added bug Something isn't working good first issue Good for newcomers labels Jan 21, 2025
@junior
Copy link
Member

junior commented Jan 21, 2025

Issue have been resolved on the version 0.4.0.

0.5.0 (That will also include the LATEST notation), will have all the unit tests and will be the officially version that fix all the version updates in all hierarchy of the pom.xml and griddle build.

@gnsuryan
Copy link
Member Author

gnsuryan commented Feb 4, 2025

Verified if the WebLogic maven plugin issue mention here is fixed in the latest weblogic open-rewrite version 0.4.
But finding that even in this version, the weblogic maven version remains unchanged in the pom.xml

Please let me know if there is any specific settings or commands, that need to be configured/executed for changes to reflect.

Steps followed:

  1. Install Maven 3.9 or above

  2. Install WebLogic Maven Plugin for WebLogic 15.1.1.0.0 version, as per the information available at https://docs.oracle.com/en/middleware/standalone/weblogic-server/14.1.1.0/wlprg/maven.html#GUID-C6FC7582-2D1C-4EA5-B000-71AE9A2F2B05 (Replace all references to14.1.1.0.0 in the documentation with 15.1.1.0.0, when running the commands)

  3. Build rewrite-weblogic-0.4.0 jar by running below commands:

  1. Install WebLogic Open Rewrite 0.4 using the following commands

mvn install:install-file
-Dfile=/path/to/rewrite-weblogic-0.4.0.jar
-DgroupId=com.oracle.weblogic.rewrite
-DartifactId=rewrite-weblogic
-Dversion=0.4.0
-Dpackaging=jar

  1. Git clone repository - https://github.com/dveselka/weblogic.git

mvn -U org.openrewrite.maven:rewrite-maven-plugin:run
-Drewrite.recipeArtifactCoordinates=com.oracle.weblogic.rewrite:rewrite-weblogic:0.4.0
-Drewrite.activeRecipes=com.oracle.weblogic.rewrite.UpgradeTo1511,org.openrewrite.java.migrate.UpgradeToJava17

  1. Run git diff command and check the difference between the git version of the files and the modified version of the files

After using the above steps, I did not notice, any change in the WebLogic version in the pom.xml file.

@junior
Copy link
Member

junior commented Feb 11, 2025

Weblogic Maven Plugin version references in pom.xml is not updated on running weblogic openrewrite

During migration of WebLogic maven plugin based applications from old versions of WebLogic (122140, 141100) to 141200 using WebLogic openrewrite, the WebLogic maven plugin versions are not updated. They remain the same as it was earlier.

To reproduce the issue, follow the below steps:

Pre-requisites:

JDK17/21 Maven 3.9.8 or above

git clone https://github.com/dveselka/WebLogic.git to a directory, say /scratch/$USER/openrewrite-testing/

cd /scratch/$USER/openrewrite-testing/WebLogic/dave-basic-project/dave-basic-webapp-project/

Open pom.xml and verify the WebLogic maven Plugin version. It should be 14.1.1.0.0

Now run open-rewrite command to migrate to 141200 JDK17/21 using below commands:

For JDK17 mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=com.oracle.WebLogic.rewrite:rewrite-WebLogic:0.3.0 -Drewrite.activeRecipes=com.oracle.WebLogic.rewrite.UpgradeTo1412,org.openrewrite.java.migrate.UpgradeToJava17

For JDK21 mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=com.oracle.WebLogic.rewrite:rewrite-WebLogic:0.3.0 -Drewrite.activeRecipes=com.oracle.WebLogic.rewrite.UpgradeTo1412,org.openrewrite.java.migrate.UpgradeToJava21

Verify the changes in pom.xml. You can notice that pom.xml has got modified with changes in JDK version, maven war plugin version etc. But the WebLogic Maven Plugin version remains the same

The expectation is that after migration, the WebLogic Maven Plugin version has to be modified accordingly. In this case, the WebLogic Maven Plugin has to be updated to 14.1.2.0.0 from 14.1.1.0.0

Latest PR fixes the issue with versions, please test using the LATEST or 0.4.2 tags.

mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=com.oracle.webLogic.rewrite:rewrite-weblogic:LATEST -Drewrite.activeRecipes=com.oracle.weblogic.rewrite.UpgradeTo1412,org.openrewrite.java.migrate.UpgradeToJava21

@junior
Copy link
Member

junior commented Feb 11, 2025

Verified if the WebLogic maven plugin issue mention here is fixed in the latest weblogic open-rewrite version 0.4. But finding that even in this version, the weblogic maven version remains unchanged in the pom.xml

Please let me know if there is any specific settings or commands, that need to be configured/executed for changes to reflect.

Steps followed:

  1. Install Maven 3.9 or above
  2. Install WebLogic Maven Plugin for WebLogic 15.1.1.0.0 version, as per the information available at https://docs.oracle.com/en/middleware/standalone/weblogic-server/14.1.1.0/wlprg/maven.html#GUID-C6FC7582-2D1C-4EA5-B000-71AE9A2F2B05 (Replace all references to14.1.1.0.0 in the documentation with 15.1.1.0.0, when running the commands)
  3. Build rewrite-weblogic-0.4.0 jar by running below commands:
  1. Install WebLogic Open Rewrite 0.4 using the following commands

mvn install:install-file -Dfile=/path/to/rewrite-weblogic-0.4.0.jar -DgroupId=com.oracle.weblogic.rewrite -DartifactId=rewrite-weblogic -Dversion=0.4.0 -Dpackaging=jar

  1. Git clone repository - https://github.com/dveselka/weblogic.git

mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=com.oracle.weblogic.rewrite:rewrite-weblogic:0.4.0 -Drewrite.activeRecipes=com.oracle.weblogic.rewrite.UpgradeTo1511,org.openrewrite.java.migrate.UpgradeToJava17

  1. Run git diff command and check the difference between the git version of the files and the modified version of the files

After using the above steps, I did not notice, any change in the WebLogic version in the pom.xml file.

Latest PR has more updates for the beta for 15.1.1.

NOTE: The Jakarta recipe need to be explicitly included. Command example:

mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
  -Drewrite.recipeArtifactCoordinates=com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST \
  -Drewrite.activeRecipes=com.oracle.weblogic.rewrite.UpgradeTo1511,org.openrewrite.java.migrate.UpgradeToJava21,com.oracle.weblogic.rewrite.JakartaEE9_1 \
  -Drewrite.exportDatatables=true

@gnsuryan
Copy link
Member Author

I have retested the issue using WebLogic open-rewrite version 0.4.2 and found that the issue still persists, when we try to migrate to WebLogic 14.1.2.

But migration to WebLogic 15.1.1 works fine.

Since, I don't have the permissions to reopen this issue, I am updating the details in the comment section.

Steps to reproduce:

git clone https://github.com/dveselka/weblogic.git
cd weblogic/dave-basic-project/
run open-rewrite maven command 

mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
-Drewrite.recipeArtifactCoordinates=com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST \
-Drewrite.activeRecipes=com.oracle.weblogic.rewrite.UpgradeTo1412,org.openrewrite.java.migrate.UpgradeToJava17
verify changes in pom.xml
Notice that the weblogic-maven-plugin version is still 14.1.1.0.0 and not updated to 14.1.2.0.0 as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants