├── rewrite-weblogic ├── images │ ├── pom-sbs.png │ ├── coffee-java-sbs.png │ └── integ-terminal-vscode.png ├── src │ ├── test │ │ └── java │ │ │ ├── .editorconfig │ │ │ └── com │ │ │ └── oracle │ │ │ └── weblogic │ │ │ └── rewrite │ │ │ ├── WeblogicVersionHelperTest.java │ │ │ ├── WeblogicRewriteTest.java │ │ │ ├── WeblogicRewriteTestVersions.java │ │ │ ├── OutputRecipeVersionTest.java │ │ │ ├── UpgradeWeblogicMavenPropertyVersionTest.java │ │ │ └── jakarta │ │ │ └── ChangeJakartaFacesMethodCallsTest.java │ └── main │ │ ├── java │ │ └── com │ │ │ └── oracle │ │ │ └── weblogic │ │ │ └── rewrite │ │ │ ├── package-info.java │ │ │ ├── OutputRecipeVersion.java │ │ │ ├── WeblogicVersionHelper.java │ │ │ ├── UpgradeWeblogicMavenPropertyVersion.java │ │ │ └── jakarta │ │ │ ├── ChangeJakartaFacesMethodCalls.java │ │ │ └── UpgradeMavenPluginArtifactItems.java │ │ └── resources │ │ └── META-INF │ │ ├── LICENSE.txt │ │ └── rewrite │ │ ├── jakarta-faces-2.yaml │ │ ├── jakarta-ee-10.yaml │ │ ├── jakarta-ee-11.yaml │ │ ├── weblogic-14.1.1.yaml │ │ ├── hibernate.yaml │ │ ├── spring-framework-6.2.yaml │ │ ├── examples-helpers.yaml │ │ ├── weblogic-deprecations.yaml │ │ └── weblogic-15.1.1.yaml ├── rewrite.yml ├── docs │ ├── procedures │ │ ├── README.md │ │ ├── upgrade-151100.md │ │ ├── upgrade-141200.md │ │ └── upgrade-151100-Spring.md │ ├── README.md │ ├── recipes │ │ ├── README.md │ │ ├── examples-helpers.md │ │ ├── migrate-to-weblogic-141200.md │ │ ├── migrate-to-weblogic-151100.md │ │ ├── migrate-to-spring-6_2.md │ │ ├── migrate-to-jakarta-EE-9_1.md │ │ └── migrate-to-weblogic-141100.md │ └── concepts │ │ └── README.md ├── pom.xml └── README.md ├── .github └── CODEOWNERS ├── pom.xml ├── .gitignore ├── SECURITY.md ├── LICENSE.txt ├── CONTRIBUTING.md ├── README.md └── THIRD_PARTY_LICENSES.txt /rewrite-weblogic/images/pom-sbs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/rewrite-recipes/HEAD/rewrite-weblogic/images/pom-sbs.png -------------------------------------------------------------------------------- /rewrite-weblogic/src/test/java/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.java] 4 | indent_size = 4 5 | ij_continuation_indent_size = 2 -------------------------------------------------------------------------------- /rewrite-weblogic/images/coffee-java-sbs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/rewrite-recipes/HEAD/rewrite-weblogic/images/coffee-java-sbs.png -------------------------------------------------------------------------------- /rewrite-weblogic/images/integ-terminal-vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle/rewrite-recipes/HEAD/rewrite-weblogic/images/integ-terminal-vscode.png -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # rewrite-weblogic Recipes Maintainers 2 | /rewrite-weblogic/ @rewrite-recipes-rewrite-weblogic-maintainers @junior @david-cabelus-oracle 3 | 4 | # 5 | /.github/CODEOWNERS @junior 6 | -------------------------------------------------------------------------------- /rewrite-weblogic/rewrite.yml: -------------------------------------------------------------------------------- 1 | type: specs.openrewrite.org/v1beta/recipe 2 | name: com.oracle.weblogic.rewrite.RecipeBestPractices 3 | displayName: Apply best practices for WebLogic recipes 4 | description: A convenience recipe to apply best practices for OpenRewrite recipes directly from the command line or IntelliJ IDEA. 5 | recipeList: 6 | - org.openrewrite.recipes.OpenRewriteBestPractices 7 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/java/com/oracle/weblogic/rewrite/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. 3 | * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. 4 | */ 5 | @NullMarked 6 | @NonNullFields 7 | package com.oracle.weblogic.rewrite; 8 | import org.jspecify.annotations.NullMarked; 9 | import org.openrewrite.internal.lang.NonNullFields; 10 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.oracle 7 | rewrite-recipes 8 | 1.0.0 9 | 10 | rewrite-recipes 11 | 12 | pom 13 | 14 | 15 | rewrite-weblogic 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/test/java/com/oracle/weblogic/rewrite/WeblogicVersionHelperTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Oracle and/or its affiliates. 3 | * 4 | * Licensed under the Universal Permissive License v 1.0 as shown at 5 | * https://oss.oracle.com/licenses/upl. 6 | * 7 | */ 8 | package com.oracle.weblogic.rewrite; 9 | 10 | import org.junit.jupiter.api.Test; 11 | import org.openrewrite.InMemoryExecutionContext; 12 | 13 | import java.util.Optional; 14 | 15 | import static org.junit.jupiter.api.Assertions.assertEquals; 16 | 17 | class WeblogicVersionHelperTest { 18 | 19 | @Test 20 | void testGetNewerVersion() { 21 | InMemoryExecutionContext ctx = new InMemoryExecutionContext(); 22 | String currentVersion = "12.2.1-4-0"; 23 | String versionPattern = "14.1.1-0-0"; 24 | 25 | Optional result = WeblogicVersionHelper.getNewerVersion(versionPattern, currentVersion, ctx); 26 | assertEquals("14.1.1-0-0", result.orElse("No newer version found")); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/test/java/com/oracle/weblogic/rewrite/WeblogicRewriteTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Oracle and/or its affiliates. 3 | * 4 | * Licensed under the Universal Permissive License v 1.0 as shown at 5 | * https://oss.oracle.com/licenses/upl. 6 | * 7 | */ 8 | package com.oracle.weblogic.rewrite; 9 | 10 | import org.junit.jupiter.api.BeforeAll; 11 | import org.junit.jupiter.api.BeforeEach; 12 | import org.openrewrite.maven.MavenDownloadingException; 13 | import org.openrewrite.test.RewriteTest; 14 | import org.openrewrite.test.SourceSpecs; 15 | 16 | import static org.openrewrite.properties.Assertions.properties; 17 | 18 | public abstract class WeblogicRewriteTest implements RewriteTest { 19 | protected static String latestApplicationPluginVersion; 20 | protected static String latestWeblogicVersion; 21 | private SourceSpecs gradleProperties; 22 | 23 | @BeforeAll 24 | static void init() throws MavenDownloadingException { 25 | latestWeblogicVersion = WeblogicRewriteTestVersions.getLatestWLS1412Version(); 26 | } 27 | 28 | @BeforeEach 29 | void initGradleProperties() { 30 | gradleProperties = properties("weblogicVersion=" + latestWeblogicVersion, s -> s.path("gradle.properties")); 31 | } 32 | 33 | protected SourceSpecs getGradleProperties() { 34 | return gradleProperties; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/test/java/com/oracle/weblogic/rewrite/WeblogicRewriteTestVersions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Oracle and/or its affiliates. 3 | * 4 | * Licensed under the Universal Permissive License v 1.0 as shown at 5 | * https://oss.oracle.com/licenses/upl. 6 | * 7 | */ 8 | package com.oracle.weblogic.rewrite; 9 | 10 | import org.openrewrite.InMemoryExecutionContext; 11 | 12 | public final class WeblogicRewriteTestVersions { 13 | private static final String WLS_1411_VERSION; 14 | private static final String WLS_1412_VERSION; 15 | private static final String WLS_1511_VERSION; 16 | 17 | static { 18 | WLS_1411_VERSION = resolveVersion("14.1.1", "14.1.1-0-0"); 19 | WLS_1412_VERSION = resolveVersion("14.1.2", "14.1.2-0-0"); 20 | WLS_1511_VERSION = resolveVersion("15.1.1", "15.1.1-0-0"); 21 | } 22 | 23 | public static String getLatestWLS1411Version() { 24 | return WLS_1411_VERSION; 25 | } 26 | 27 | public static String getLatestWLS1412Version() { 28 | return WLS_1412_VERSION; 29 | } 30 | 31 | public static String getLatestWLS1511Version() { 32 | return WLS_1511_VERSION; 33 | } 34 | 35 | private static String resolveVersion(String versionPattern, String currentVersion) { 36 | return WeblogicVersionHelper.getNewerVersion(versionPattern, currentVersion, new InMemoryExecutionContext()) 37 | .orElse(currentVersion); 38 | } 39 | 40 | private WeblogicRewriteTestVersions() { 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /rewrite-weblogic/docs/procedures/README.md: -------------------------------------------------------------------------------- 1 | # How to run recipes 2 | 3 | Depending on your application dependencies and WebLogic Server and JDK source versions, you can use one or more recipes to accomplish your goals. Recipes are stackable meaning that you can run more than one recipe at a time, within a single command or Maven configuration. 4 | 5 | You can run Rewrite WebLogic recipes on your code folder using the Maven or Gradle CLI, or include them as a build plug-in in your `pom.xml` or `build.gradle` file. After running recipes, you are notified of all of the files that have been changed. To see what's changed in the code, run `git diff` or use your preferred IDE's diff viewer. From there, you can commit the changes or add additional recipes based on your needs. 6 | 7 | > [!TIP] 8 | > If you're using WebLogic artifacts, you need to install the corresponding [WebLogic Maven plug-in](https://docs.oracle.com/en/middleware/fusion-middleware/weblogic-server/14.1.2/wlprg/maven.html#GUID-7759C76C-D6E9-4A7E-BE99-96787814576D) version (for example, 14.1.1). After migration (for example, to 15.1.1), update and sync the plug-in version accordingly, before building the migrated application. 9 | 10 | # Procedures 11 | 12 | The following procedures illustrate the methods to upgrade your applications, WebLogic Server, and Java versions: 13 | 14 | - [Upgrade to WebLogic Server 14.1.2](upgrade-141200.md) 15 | - [Upgrade to WebLogic Server 15.1.1](upgrade-151100.md) 16 | - [Upgrade to WebLogic Server 15.1.1 with Spring Framework](https://github.com/oracle-samples/weblogic-examples/blob/main/tutorials/migrate/spring-framework-petclinic-15.1.1/README.md) 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Java ### 2 | # Compiled class file 3 | *.class 4 | 5 | # Log file 6 | *.log 7 | 8 | # BlueJ files 9 | *.ctxt 10 | 11 | # Mobile Tools for Java (J2ME) 12 | .mtj.tmp/ 13 | 14 | # Package Files # 15 | *.jar 16 | *.war 17 | *.nar 18 | *.ear 19 | *.zip 20 | *.tar.gz 21 | *.rar 22 | 23 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 24 | hs_err_pid* 25 | replay_pid* 26 | 27 | ### macOS ### 28 | # General 29 | .DS_Store 30 | .AppleDouble 31 | .LSOverride 32 | 33 | # Icon must end with two \r 34 | Icon 35 | 36 | 37 | # Thumbnails 38 | ._* 39 | 40 | ### macOS Patch ### 41 | # iCloud generated files 42 | *.icloud 43 | 44 | ### Maven ### 45 | target/ 46 | pom.xml.tag 47 | pom.xml.releaseBackup 48 | pom.xml.versionsBackup 49 | pom.xml.next 50 | release.properties 51 | dependency-reduced-pom.xml 52 | buildNumber.properties 53 | .mvn/timing.properties 54 | # https://github.com/takari/maven-wrapper#usage-without-binary-jar 55 | .mvn/wrapper/maven-wrapper.jar 56 | 57 | # Eclipse m2e generated files 58 | # Eclipse Core 59 | .project 60 | # JDT-specific (Eclipse Java Development Tools) 61 | .classpath 62 | 63 | # IntelliJ IDEA 64 | .idea/ 65 | 66 | # VS Code 67 | .vscode/ 68 | 69 | ### Gradle ### 70 | .gradle 71 | **/build/ 72 | !src/**/build/ 73 | 74 | # Ignore Gradle GUI config 75 | gradle-app.setting 76 | 77 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 78 | !gradle-wrapper.jar 79 | 80 | # Avoid ignore Gradle wrappper properties 81 | !gradle-wrapper.properties 82 | 83 | # Cache of project 84 | .gradletasknamecache 85 | 86 | # Eclipse Gradle plugin generated files 87 | # Eclipse Core 88 | # JDT-specific (Eclipse Java Development Tools) 89 | 90 | ### Gradle Patch ### 91 | # Java heap dump 92 | *.hprof 93 | -------------------------------------------------------------------------------- /rewrite-weblogic/docs/README.md: -------------------------------------------------------------------------------- 1 | # Welcome to WebLogic Server application upgrade tooling 2 | 3 | WebLogic Server application upgrade tooling employs [OpenRewrite](https://github.com/openrewrite/rewrite) recipes for upgrading applications to newer versions of WebLogic Server, Java, Jakarta EE, and related versions of Jakarta Server Faces and Spring Framework. Here, you'll find recipes that perform the functions you need to successfully upgrade your applications. Use [Rewrite WebLogic](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/README.md) recipes to migrate your applications to WebLogic 14.1.2 and Java 17 or Java 21, or to WebLogic 15.1.1, Jakarta EE 9.1, and Java 17 or Java 21. 4 | 5 | ## Documentation 6 | 7 | To learn all about what WebLogic Server application upgrade tooling has to offer, see: 8 | 9 | - [What is WebLogic Server application upgrade tooling?](./concepts/README.md) 10 | - [How to run recipes](./procedures/README.md) 11 | - [Rewrite WebLogic recipes](./recipes/README.md) 12 | 13 | 14 | ## Examples and tutorials 15 | 16 | Use the WebLogic Rewrite recipes in the [WebLogic Examples and Tutorials](https://github.com/oracle-samples/weblogic-examples) repository to learn how to migrate applications to updated versions of WebLogic, Java, and to Jakarta EE 9. 17 | 18 | - [Migrate WebLogic Cafe to WLS 14.1.2](https://github.com/oracle-samples/weblogic-examples/blob/main/tutorials/migrate/weblogic-cafe-14.1.2/README.md) 19 | - [Migrate WebLogic Cafe to WLS 15.1.1](https://github.com/oracle-samples/weblogic-examples/blob/main/tutorials/migrate/weblogic-cafe-15.1.1/README.md) 20 | - [Migrate Spring Framework PetClinic to WLS 15.1.1](https://github.com/oracle-samples/weblogic-examples/blob/main/tutorials/migrate/spring-framework-petclinic-15.1.1/README.md) 21 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting security vulnerabilities 2 | 3 | Oracle values the independent security research community and believes that 4 | responsible disclosure of security vulnerabilities helps us ensure the security 5 | and privacy of all our users. 6 | 7 | Please do NOT raise a GitHub Issue to report a security vulnerability. If you 8 | believe you have found a security vulnerability, please submit a report to 9 | [secalert_us@oracle.com][1] preferably with a proof of concept. Please review 10 | some additional information on [how to report security vulnerabilities to Oracle][2]. 11 | We encourage people who contact Oracle Security to use email encryption using 12 | [our encryption key][3]. 13 | 14 | We ask that you do not use other channels or contact the project maintainers 15 | directly. 16 | 17 | Non-vulnerability related security issues including ideas for new or improved 18 | security features are welcome on GitHub Issues. 19 | 20 | ## Security updates, alerts and bulletins 21 | 22 | Security updates will be released on a regular cadence. Many of our projects 23 | will typically release security fixes in conjunction with the 24 | Oracle Critical Patch Update program. Additional 25 | information, including past advisories, is available on our [security alerts][4] 26 | page. 27 | 28 | ## Security-related information 29 | 30 | We will provide security related information such as a threat model, considerations 31 | for secure use, or any known security issues in our documentation. Please note 32 | that labs and sample code are intended to demonstrate a concept and may not be 33 | sufficiently hardened for production use. 34 | 35 | [1]: mailto:secalert_us@oracle.com 36 | [2]: https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html 37 | [3]: https://www.oracle.com/security-alerts/encryptionkey.html 38 | [4]: https://www.oracle.com/security-alerts/ 39 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. 2 | 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 4 | 5 | Subject to the condition set forth below, permission is hereby granted to any 6 | person obtaining a copy of this software, associated documentation and/or data 7 | (collectively the "Software"), free of charge and under any and all copyright 8 | rights in the Software, and any and all patent rights owned or freely 9 | licensable by each licensor hereunder covering either (i) the unmodified 10 | Software as contributed to or provided by such licensor, or (ii) the Larger 11 | Works (as defined below), to deal in both 12 | 13 | (a) the Software, and 14 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 15 | one is included with the Software (each a "Larger Work" to which the Software 16 | is contributed by such licensors), 17 | 18 | without restriction, including without limitation the rights to copy, create 19 | derivative works of, display, perform, and distribute the Software and make, 20 | use, sell, offer for sale, import, export, have made, and have sold the 21 | Software and the Larger Work(s), and to sublicense the foregoing rights on 22 | either these or other terms. 23 | 24 | This license is subject to the following condition: 25 | The above copyright notice and either this complete permission notice or at 26 | a minimum a reference to the UPL must be included in all copies or 27 | substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 35 | SOFTWARE. 36 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/resources/META-INF/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. 2 | 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. 4 | 5 | Subject to the condition set forth below, permission is hereby granted to any 6 | person obtaining a copy of this software, associated documentation and/or data 7 | (collectively the "Software"), free of charge and under any and all copyright 8 | rights in the Software, and any and all patent rights owned or freely 9 | licensable by each licensor hereunder covering either (i) the unmodified 10 | Software as contributed to or provided by such licensor, or (ii) the Larger 11 | Works (as defined below), to deal in both 12 | 13 | (a) the Software, and 14 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 15 | one is included with the Software (each a "Larger Work" to which the Software 16 | is contributed by such licensors), 17 | 18 | without restriction, including without limitation the rights to copy, create 19 | derivative works of, display, perform, and distribute the Software and make, 20 | use, sell, offer for sale, import, export, have made, and have sold the 21 | Software and the Larger Work(s), and to sublicense the foregoing rights on 22 | either these or other terms. 23 | 24 | This license is subject to the following condition: 25 | The above copyright notice and either this complete permission notice or at 26 | a minimum a reference to the UPL must be included in all copies or 27 | substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 35 | SOFTWARE. 36 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/java/com/oracle/weblogic/rewrite/OutputRecipeVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 Oracle and/or its affiliates. 3 | * 4 | * Licensed under the Universal Permissive License v 1.0 as shown at 5 | * https://oss.oracle.com/licenses/upl. 6 | * 7 | */ 8 | package com.oracle.weblogic.rewrite; 9 | 10 | import org.openrewrite.*; 11 | import org.openrewrite.maven.MavenIsoVisitor; 12 | import org.openrewrite.xml.tree.Xml; 13 | 14 | /** 15 | * A recipe that outputs the version of the recipe after it runs. 16 | * This is useful for tracking and debugging purposes. 17 | * Currently only works with recipes called using Maven. Gradle TBD. 18 | */ 19 | public class OutputRecipeVersion extends Recipe { 20 | 21 | @Override 22 | public String getDisplayName() { 23 | return "Output Recipe Version"; 24 | } 25 | 26 | @Override 27 | public String getDescription() { 28 | return "Displays the version of the recipe after it runs."; 29 | } 30 | 31 | @Override 32 | public TreeVisitor getVisitor() { 33 | return new MavenIsoVisitor() { 34 | @Override 35 | public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) { 36 | Xml.Document d = super.visitDocument(document, ctx); 37 | 38 | // Display the title and version of the recipe 39 | displayRecipeInfo(); 40 | 41 | return d; 42 | } 43 | }; 44 | } 45 | 46 | private void displayRecipeInfo() { 47 | Package pkg = OutputRecipeVersion.class.getPackage(); 48 | String title = pkg.getImplementationTitle(); 49 | String version = pkg.getImplementationVersion(); 50 | if (title == null) { 51 | title = "Title information not available"; 52 | } 53 | if (version == null) { 54 | version = "Version information not available"; 55 | } 56 | System.out.println(String.format("--- Running recipe(s) from %s:%s", title, version)); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/test/java/com/oracle/weblogic/rewrite/OutputRecipeVersionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 Oracle and/or its affiliates. 3 | * 4 | * Licensed under the Universal Permissive License v 1.0 as shown at 5 | * https://oss.oracle.com/licenses/upl. 6 | * 7 | */ 8 | package com.oracle.weblogic.rewrite; 9 | 10 | import org.junit.jupiter.api.Test; 11 | import org.openrewrite.DocumentExample; 12 | import org.openrewrite.test.RewriteTest; 13 | import static org.openrewrite.maven.Assertions.pomXml; 14 | 15 | public class OutputRecipeVersionTest implements RewriteTest { 16 | 17 | @DocumentExample 18 | @Test 19 | void testOutputRecipeVersion() { 20 | rewriteRun(spec -> spec.recipe(new OutputRecipeVersion()), 21 | //language=xml 22 | pomXml( 23 | """ 24 | 25 | 4.0.0 26 | com.mycompany.app 27 | my-app 28 | 1.0.0 29 | 30 | 31 | 32 | org.apache.maven.plugins 33 | maven-jar-plugin 34 | 3.4.2 35 | 36 | 37 | 38 | ${project.name} 39 | ${project.version} 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | """ 48 | ) 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /rewrite-weblogic/docs/recipes/README.md: -------------------------------------------------------------------------------- 1 | # Rewrite WebLogic recipes 2 | 3 | Look here for detailed information about each of the following Rewrite WebLogic composite recipes (recipes that consist of a list of other recipes). Depending on your application dependencies and WebLogic Server and JDK source versions, you can use one or more recipes to accomplish your goals. 4 | 5 | For detailed information about running recipes, see [How to run recipes](../procedures/README.md) and the [WebLogic Examples and Tutorials](https://github.com/oracle-samples/weblogic-examples) repository. 6 | 7 | > [!NOTE] 8 | > These recipes do not address _any_ other third-party dependencies. For all other third-party dependencies, you _must_ find or create an additional [recipe](https://docs.openrewrite.org/recipes) to do the migration, or make manual code changes after the migration. 9 | 10 | | Composite Recipes | Descriptions | 11 | | --- | --- | 12 | | [Migrate to WebLogic 15.1.1](migrate-to-weblogic-151100.md) | This recipe will update the WebLogic version to 15.1.1 for the Maven build and comment out deprecated and removed APIs.
**NOTE**: The UpgradeTo1511 recipe must be run **after** the Java and Jakarta recipes. | 13 | | [Migrate to WebLogic 14.1.2](migrate-to-weblogic-141200.md) | This recipe will upgrade the WebLogic version to 14.1.2 for the Maven build, and comment out deprecated and removed APIs. | 14 | | [Migrate to WebLogic 14.1.1](migrate-to-weblogic-141100.md) | This recipe will update the WebLogic version to 14.1.1 for the Maven build and will apply changes commonly needed when upgrading to Java 11. | 15 | | [Migrate to Jakarta EE 9.1](migrate-to-jakarta-EE-9_1.md) | This recipe will update Jakarta EE platform dependencies to 9.1.0, and flag and update deprecated methods. | 16 | | [Migrate to Spring Framework 6.2 for WebLogic 15.1.1](migrate-to-spring-6_2.md) | This recipe migrates applications to the Spring Framework 6.2 release and to compatibility with WebLogic 15.1.1.
**NOTE**: This recipe is intended for migration from Spring Framework version 5.3 or later. We have not tested and we don’t support updating from earlier versions of Spring Framework.| 17 | | [Examples Helpers](examples-helpers.md) | This recipe will help you run the migrated Spring Framework PetClinic example on WebLogic 15.1.1. | 18 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to this repository 2 | 3 | We welcome your contributions! There are multiple ways to contribute. 4 | 5 | ## Opening issues 6 | 7 | For bugs or enhancement requests, please file a GitHub issue unless it's 8 | security related. When filing a bug remember that the better written the bug is, 9 | the more likely it is to be fixed. If you think you've found a security 10 | vulnerability, do not raise a GitHub issue and follow the instructions in our 11 | [security policy](./SECURITY.md). 12 | 13 | ## Contributing code 14 | 15 | We welcome your code contributions. Before submitting code via a pull request, 16 | you will need to have signed the [Oracle Contributor Agreement][OCA] (OCA) and 17 | your commits need to include the following line using the name and e-mail 18 | address you used to sign the OCA: 19 | 20 | ```text 21 | Signed-off-by: Your Name 22 | ``` 23 | 24 | This can be automatically added to pull requests by committing with `--sign-off` 25 | or `-s`, e.g. 26 | 27 | ```text 28 | git commit --signoff 29 | ``` 30 | 31 | Only pull requests from committers that can be verified as having signed the OCA 32 | can be accepted. 33 | 34 | ## Pull request process 35 | 36 | 1. Ensure there is an issue created to track and discuss the fix or enhancement 37 | you intend to submit. 38 | 1. Fork this repository 39 | 1. Create a branch in your fork to implement the changes. We recommend using 40 | the issue number as part of your branch name, e.g. `1234-fixes` 41 | 1. Ensure that any documentation is updated with the changes that are required 42 | by your change. 43 | 1. Ensure that any samples are updated if the base image has been changed. 44 | 1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly 45 | what your changes are meant to do and provide simple steps on how to validate 46 | your changes. Ensure that you reference the issue you created as well. 47 | 1. We will assign the pull request to 2-3 people for review before it is merged. 48 | 49 | ## Code of conduct 50 | 51 | Follow the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule). If you'd 52 | like more specific guidelines, see the [Contributor Covenant Code of Conduct][COC]. 53 | 54 | [OCA]: https://oca.opensource.oracle.com 55 | [COC]: https://www.contributor-covenant.org/version/1/4/code-of-conduct/ 56 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/java/com/oracle/weblogic/rewrite/WeblogicVersionHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Oracle and/or its affiliates. 3 | * 4 | * Licensed under the Universal Permissive License v 1.0 as shown at 5 | * https://oss.oracle.com/licenses/upl. 6 | * 7 | */ 8 | package com.oracle.weblogic.rewrite; 9 | 10 | import org.openrewrite.ExecutionContext; 11 | import org.openrewrite.semver.LatestRelease; 12 | import org.openrewrite.semver.Semver; 13 | import org.openrewrite.semver.VersionComparator; 14 | 15 | import java.util.ArrayList; 16 | import java.util.Collection; 17 | import java.util.List; 18 | import java.util.Optional; 19 | 20 | /** 21 | * Utility class for WebLogic version management. 22 | */ 23 | public final class WeblogicVersionHelper { 24 | 25 | private static final LatestRelease LATEST_RELEASE = new LatestRelease(null); 26 | 27 | /** 28 | * A list of locally supported WebLogic versions. 29 | */ 30 | public static final List LOCAL_VERSIONS = List.of( 31 | "14.1.1-0-0", "14.1.2-0-0", "15.1.1-0-0" 32 | ); 33 | 34 | /** 35 | * Finds a newer version of WebLogic that matches the given version pattern and is newer than the current version. 36 | * 37 | * @param versionPattern A semver pattern to match the desired version. 38 | * @param currentVersion The current version of WebLogic. 39 | * @param ctx The execution context for logging or additional processing. 40 | * @return An {@link Optional} containing the newest matching version, or empty if no newer version is found. 41 | */ 42 | public static Optional getNewerVersion(String versionPattern, String currentVersion, ExecutionContext ctx) { 43 | VersionComparator versionComparator = Semver.validate(versionPattern, null).getValue(); 44 | assert versionComparator != null; 45 | 46 | Collection availableVersions = new ArrayList<>(); 47 | for (String v : LOCAL_VERSIONS) { 48 | if (versionComparator.isValid(null, v)) { 49 | availableVersions.add(v); 50 | } 51 | } 52 | 53 | return availableVersions.stream() 54 | .filter(v -> LATEST_RELEASE.compare(null, currentVersion, v) < 0) 55 | .max(LATEST_RELEASE); 56 | } 57 | 58 | private WeblogicVersionHelper() { 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenRewrite Recipes 2 | 3 | This project implements [OpenRewrite](https://docs.openrewrite.org) recipes for Oracle products. 4 | 5 | Each folder of this project contains a group recipe that can contain multiple composite recipes. Each composite recipe is a set of recipes that you can use to migrate to a specific version of a product. 6 | 7 | Example: `rewrite-weblogic` is a group recipe that contains composite recipes, like ones to migrate your WebLogic applications to WebLogic 14.1.2 and Java 21, or to WebLogic 14.1.2 and Java 17. With each new version of WebLogic, a new composite recipe will be added, for example, to migrate to WebLogic 15.1.1. 8 | 9 | ## Getting Started 10 | 11 | Before getting started, select the recipe you want to use. Each recipe has its own README file that explains how to use it. 12 | 13 | | Recipe | Description | 14 | | :--- | --- | 15 | | [rewrite-weblogic](rewrite-weblogic/README.md)  | Migrate your WebLogic applications to the latest version of WebLogic and Java with OpenRewrite. Automatically. | 16 | 17 | > [!TIP] 18 | > Click on the recipe name to get more details about a specific recipe (for example, `rewrite-weblogic`) and how to use it 19 | 20 | ## Get Help 21 | 22 | For `rewrite-weblogic`: 23 | 24 | We have a public Slack channel where you can get in touch with us to ask questions about using OpenRewrite recipes with WebLogic, or give us feedback or suggestions about features and improvements you would like to see. We would love to hear from you. 25 | 26 | To join our channel, please visit this [site](https://join.slack.com/t/oracle-weblogic/shared_invite/zt-32ly2o8nl-HjLiIM4fazQ3vjZaqHPPRQ) to get an invitation. The invitation email will include details on how to access our Slack workspace. After you are logged in, please go to #wls-app-upgrade-openrewrite and say, "Hello!" 27 | 28 | ## Contributing 29 | 30 | This project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md). 31 | 32 | ## Security 33 | 34 | Please consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process. 35 | 36 | ## License 37 | 38 | Copyright (c) 2025 Oracle and/or its affiliates. 39 | 40 | Released under the Universal Permissive License v1.0 as shown at 41 | . 42 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/resources/META-INF/rewrite/jakarta-faces-2.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2025 the original author or authors. 3 | #

4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | #

8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | #

10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | --- 17 | type: specs.openrewrite.org/v1beta/recipe 18 | name: com.oracle.weblogic.rewrite.FacesMigrationToJakartaFaces2x 19 | displayName: JSF 1.x to Jakarta Server Faces 2.3 on WebLogic 14.1.2 or older 20 | description: Jakarta EE 8 uses Faces 2.3 a major upgrade to Jakarta packages and XML namespaces. This recipe will migrate JSF 1.x to Jakarta Server Faces 2.3 on WebLogic 14.1.2 or older. 21 | tags: 22 | - jakarta 23 | - jakartaee 24 | - faces 25 | - jsf 26 | - javax 27 | recipeList: 28 | - com.oracle.weblogic.rewrite.jakarta.UpgradeFacesOpenSourceLibraries2 29 | --- 30 | type: specs.openrewrite.org/v1beta/recipe 31 | name: com.oracle.weblogic.rewrite.jakarta.UpgradeFacesOpenSourceLibraries2 32 | displayName: Upgrade Faces open source libraries 33 | description: Upgrade PrimeFaces, OmniFaces, and MyFaces libraries to Jakarta EE9 versions. 34 | tags: 35 | - jakarta 36 | - faces 37 | - jsf 38 | - myfaces 39 | - omnifaces 40 | - primefaces 41 | recipeList: 42 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion: 43 | groupId: org.primefaces 44 | artifactId: primefaces 45 | newVersion: 8.0.x 46 | versionPattern: '-LTS' 47 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion: 48 | groupId: org.primefaces.extensions 49 | artifactId: primefaces-extensions 50 | newVersion: 8.0.x 51 | versionPattern: '-LTS' 52 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion: 53 | groupId: org.omnifaces 54 | artifactId: omnifaces 55 | newVersion: 3.x 56 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion: 57 | groupId: org.apache.myfaces.core 58 | artifactId: myfaces-api 59 | newVersion: 2.3.x 60 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion: 61 | groupId: org.apache.myfaces.core 62 | artifactId: myfaces-impl 63 | newVersion: 2.3.x -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/resources/META-INF/rewrite/jakarta-ee-10.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. 3 | 4 | # Licensed under the Universal Permissive License v 1.0 as shown at 5 | # https://oss.oracle.com/licenses/upl. 6 | 7 | # Subject to the condition set forth below, permission is hereby granted to any 8 | # person obtaining a copy of this software, associated documentation and/or data 9 | # (collectively the "Software"), free of charge and under any and all copyright 10 | # rights in the Software, and any and all patent rights owned or freely 11 | # licensable by each licensor hereunder covering either (i) the unmodified 12 | # Software as contributed to or provided by such licensor, or (ii) the Larger 13 | # Works (as defined below), to deal in both 14 | 15 | # (a) the Software, and 16 | # (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | # one is included with the Software (each a "Larger Work" to which the Software 18 | # is contributed by such licensors), 19 | 20 | # without restriction, including without limitation the rights to copy, create 21 | # derivative works of, display, perform, and distribute the Software and make, 22 | # use, sell, offer for sale, import, export, have made, and have sold the 23 | # Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | # either these or other terms. 25 | 26 | # This license is subject to the following condition: 27 | # The above copyright notice and either this complete permission notice or at 28 | # a minimum a reference to the UPL must be included in all copies or 29 | # substantial portions of the Software. 30 | 31 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | # SOFTWARE. 38 | --- 39 | type: specs.openrewrite.org/v1beta/recipe 40 | name: com.oracle.weblogic.rewrite.jakarta.UpdateJakartaPersistenceTo31 41 | displayName: Update Jakarta Persistence to 3.1 42 | description: Update Jakarta Persistence to 3.1. 43 | tags: 44 | - jakartaee 45 | - persistence 46 | - weblogic 47 | recipeList: 48 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion: 49 | groupId: jakarta.persistence 50 | artifactId: jakarta.persistence-api 51 | newVersion: 3.1.x -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/resources/META-INF/rewrite/jakarta-ee-11.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. 3 | 4 | # Licensed under the Universal Permissive License v 1.0 as shown at 5 | # https://oss.oracle.com/licenses/upl. 6 | 7 | # Subject to the condition set forth below, permission is hereby granted to any 8 | # person obtaining a copy of this software, associated documentation and/or data 9 | # (collectively the "Software"), free of charge and under any and all copyright 10 | # rights in the Software, and any and all patent rights owned or freely 11 | # licensable by each licensor hereunder covering either (i) the unmodified 12 | # Software as contributed to or provided by such licensor, or (ii) the Larger 13 | # Works (as defined below), to deal in both 14 | 15 | # (a) the Software, and 16 | # (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | # one is included with the Software (each a "Larger Work" to which the Software 18 | # is contributed by such licensors), 19 | 20 | # without restriction, including without limitation the rights to copy, create 21 | # derivative works of, display, perform, and distribute the Software and make, 22 | # use, sell, offer for sale, import, export, have made, and have sold the 23 | # Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | # either these or other terms. 25 | 26 | # This license is subject to the following condition: 27 | # The above copyright notice and either this complete permission notice or at 28 | # a minimum a reference to the UPL must be included in all copies or 29 | # substantial portions of the Software. 30 | 31 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | # SOFTWARE. 38 | --- 39 | type: specs.openrewrite.org/v1beta/recipe 40 | name: com.oracle.weblogic.rewrite.jakarta.UpdateJakartaPersistenceTo32 41 | displayName: Update Jakarta Persistence to 3.2 42 | description: Update Jakarta Persistence to 3.2. 43 | tags: 44 | - jakartaee 45 | - persistence 46 | - weblogic 47 | recipeList: 48 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion: 49 | groupId: jakarta.persistence 50 | artifactId: jakarta.persistence-api 51 | newVersion: 3.2.x -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/resources/META-INF/rewrite/weblogic-14.1.1.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. 3 | 4 | # Licensed under the Universal Permissive License v 1.0 as shown at 5 | # https://oss.oracle.com/licenses/upl. 6 | 7 | # Subject to the condition set forth below, permission is hereby granted to any 8 | # person obtaining a copy of this software, associated documentation and/or data 9 | # (collectively the "Software"), free of charge and under any and all copyright 10 | # rights in the Software, and any and all patent rights owned or freely 11 | # licensable by each licensor hereunder covering either (i) the unmodified 12 | # Software as contributed to or provided by such licensor, or (ii) the Larger 13 | # Works (as defined below), to deal in both 14 | 15 | # (a) the Software, and 16 | # (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | # one is included with the Software (each a "Larger Work" to which the Software 18 | # is contributed by such licensors), 19 | 20 | # without restriction, including without limitation the rights to copy, create 21 | # derivative works of, display, perform, and distribute the Software and make, 22 | # use, sell, offer for sale, import, export, have made, and have sold the 23 | # Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | # either these or other terms. 25 | 26 | # This license is subject to the following condition: 27 | # The above copyright notice and either this complete permission notice or at 28 | # a minimum a reference to the UPL must be included in all copies or 29 | # substantial portions of the Software. 30 | 31 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | # SOFTWARE. 38 | --- 39 | type: specs.openrewrite.org/v1beta/recipe 40 | name: com.oracle.weblogic.rewrite.UpgradeTo1411 41 | displayName: Migrate to WebLogic 14.1.1 42 | description: This recipe will apply changes required for migrating to WebLogic 14.1.1 43 | tags: 44 | - weblogic 45 | - java 46 | recipeList: 47 | - org.openrewrite.java.migrate.Java8toJava11 48 | - org.openrewrite.maven.ChangePropertyValue: 49 | key: weblogic.version 50 | newValue: 14.1.1-0-0 51 | - org.openrewrite.maven.UpgradeParentVersion: 52 | groupId: com.oracle.weblogic.archetype 53 | artifactId: wls-common 54 | newVersion: 14.1.1-0-0 55 | - org.openrewrite.maven.UpgradePluginVersion: 56 | groupId: com.oracle.weblogic 57 | artifactId: org.glassfish.javax.json 58 | newVersion: 14.1.1-0-0 59 | trustParent: "True" 60 | - org.openrewrite.maven.UpgradePluginVersion: 61 | groupId: com.oracle.weblogic 62 | artifactId: javax.javaee-api 63 | newVersion: 14.1.1-0-0 64 | trustParent: "True" 65 | - org.openrewrite.maven.UpgradePluginVersion: 66 | groupId: com.oracle.weblogic 67 | artifactId: org.codehaus.jettison.jettison 68 | newVersion: 14.1.1-0-0 69 | trustParent: "True" 70 | - org.openrewrite.maven.UpgradePluginVersion: 71 | groupId: com.oracle.weblogic 72 | artifactId: javax.javaee-api 73 | newVersion: 14.1.1-0-0 74 | trustParent: "True" 75 | -------------------------------------------------------------------------------- /rewrite-weblogic/docs/recipes/examples-helpers.md: -------------------------------------------------------------------------------- 1 | # Examples Helpers 2 | **com.oracle.weblogic.rewrite.examples.spring.MigratedPetClinicExtrasFor1511** 3 | 4 | This recipe adds migration extras for migrating the Spring Framework PetClinic example to run on WebLogic 15.1.1. 5 | 6 | ### Tags: 7 | - springframework 8 | - examples 9 | - petclinic 10 | - weblogic 11 | 12 | ### Recipe source 13 | 14 | [examples-helpers.yaml](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/examples-helpers.yaml) 15 | 16 | ### Recipe list: 17 | - com.oracle.weblogic.rewrite.examples.spring.ChangeCacheManagerToSimpleCacheManager 18 | - com.oracle.weblogic.rewrite.examples.AddImplicitTldFileWithTaglib3_0 19 | 20 | ### Usage 21 | 22 | This recipe will help you run the migrated Spring Framework PetClinic example on WebLogic 15.1.1. 23 | 24 | #### Maven POM 25 | 26 | 1. Add the following to your Maven POM file. 27 | ``` 28 | 29 | org.openrewrite.maven 30 | rewrite-maven-plugin 31 | 6.3.1 32 | 33 | true 34 | 35 | com.oracle.weblogic.rewrite.examples.spring.MigratedPetClinicExtrasFor1511 36 | 37 | 38 | 39 | 40 | org.openrewrite.recipe 41 | rewrite-migrate-java 42 | 3.4.0 43 | 44 | 45 | com.oracle.weblogic.rewrite 46 | rewrite-weblogic 47 | [0.4.5,) 48 | 49 | 50 | 51 | ... 52 | ``` 53 | 2. Run `mvn rewrite:run` to run the recipe. 54 | 55 | > [!TIP] 56 | > If you just want to dry run the recipe without changing the code, use `mvn rewrite:DryRun`. For more details when using Maven, see [here](https://docs.openrewrite.org/reference/rewrite-maven-plugin). 57 | 58 | #### Gradle 59 | 60 | 1. Add the following to your `build.gradle` file: 61 | 62 | ``` 63 | plugins { 64 | id("org.openrewrite.rewrite") version("7.1.4") 65 | } 66 | 67 | rewrite { 68 | activeRecipe("com.oracle.weblogic.rewrite.examples.spring.MigratedPetClinicExtrasFor1511") 69 | setExportDatatables(true) 70 | } 71 | 72 | repositories { 73 | mavenCentral() 74 | } 75 | 76 | dependencies { 77 | rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.2.0") 78 | rewrite("com.oracle.weblogic.rewrite:rewrite-weblogic:+") 79 | } 80 | ``` 81 | 2. Run `gradle rewriteRun` to run the recipe. 82 | 83 | > [!TIP] 84 | > If you just want to dry run the recipe without changing the code, use `gradle rewriteDryRun`. For more details about the "dryRun" task, see [here](https://docs.openrewrite.org/reference/gradle-plugin-configuration#the-dryrun-task). 85 | 86 | #### Maven command line 87 | 88 | > [!NOTE] 89 | > You will need to have [Maven](https://maven.apache.org/download.cgi) installed on your machine before you can run the following command. 90 | 91 | ``` 92 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 93 | -Drewrite.recipeArtifactCoordinates=com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST,org.openrewrite.recipe:rewrite-hibernate:RELEASE \ 94 | -Drewrite.activeRecipes=com.oracle.weblogic.rewrite.examples.spring.MigratedPetClinicExtrasFor1511 \ 95 | -Drewrite.exportDatatables=true 96 | ``` 97 | -------------------------------------------------------------------------------- /rewrite-weblogic/docs/recipes/migrate-to-weblogic-141200.md: -------------------------------------------------------------------------------- 1 | # Migrate to WebLogic 14.1.2 2 | **com.oracle.weblogic.rewrite.UpgradeTo1412** 3 | 4 | This recipe applies the changes required for upgrading to WebLogic Server 14.1.2.0.0. 5 | 6 | ### Tags: 7 | - weblogic 8 | - java 9 | 10 | ### Recipe source 11 | 12 | [weblogic-14.1.2.yaml](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/weblogic-14.1.2.yaml) 13 | 14 | ### Recipe list: 15 | - com.oracle.weblogic.rewrite.UpdateBuildToWebLogic1412 16 | - com.oracle.weblogic.rewrite.CheckAndCommentOutDeprecations1412 17 | - [com.oracle.weblogic.rewrite.FacesMigrationToJakartaFaces2x](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/jakarta-faces-2.yaml) 18 | - com.oracle.weblogic.rewrite.MigrateWebLogicSchemasTo1412 19 | - com.oracle.weblogic.rewrite.WebLogic1412JavaXmlBindMitigation 20 | 21 | ### Usage 22 | 23 | This recipe will upgrade the WebLogic version to 14.1.2 for the Maven build, and comment out deprecated and removed APIs. 24 | 25 | #### Maven POM 26 | 27 | 1. Add the following to your Maven POM file. 28 | ``` 29 | 30 | org.openrewrite.maven 31 | rewrite-maven-plugin 32 | 6.3.1 33 | 34 | true 35 | 36 | com.oracle.weblogic.rewrite.UpgradeTo1412 37 | 38 | 39 | 40 | 41 | org.openrewrite.recipe 42 | rewrite-migrate-java 43 | 3.4.0 44 | 45 | 46 | com.oracle.weblogic.rewrite 47 | rewrite-weblogic 48 | [0.4.5,) 49 | 50 | 51 | 52 | ... 53 | ``` 54 | 2. Run `mvn rewrite:run` to run the recipe. 55 | 56 | > [!TIP] 57 | > If you just want to dry run the recipe without changing the code, use `mvn rewrite:DryRun`. For more details when using Maven, see [here](https://docs.openrewrite.org/reference/rewrite-maven-plugin). 58 | 59 | #### Gradle 60 | 61 | 1. Add the following to your `build.gradle` file: 62 | 63 | ``` 64 | plugins { 65 | id("org.openrewrite.rewrite") version("7.2.0") 66 | } 67 | 68 | rewrite { 69 | activeRecipe("com.oracle.weblogic.rewrite.UpgradeTo1412") 70 | setExportDatatables(true) 71 | } 72 | 73 | repositories { 74 | mavenCentral() 75 | } 76 | 77 | dependencies { 78 | rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.4.0") 79 | rewrite("com.oracle.weblogic.rewrite:rewrite-weblogic:+") 80 | } 81 | ``` 82 | 2. Run `gradle rewriteRun` to run the recipe. 83 | 84 | > [!TIP] 85 | > If you just want to dry run the recipe without changing the code, use `gradle rewriteDryRun`. For more details about the "dryRun" task, see [here](https://docs.openrewrite.org/reference/gradle-plugin-configuration#the-dryrun-task). 86 | 87 | #### Maven command line 88 | 89 | > [!NOTE] 90 | > You will need to have [Maven](https://maven.apache.org/download.cgi) installed on your machine before you can run the following command. 91 | 92 | ``` 93 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 94 | -Drewrite.recipeArtifactCoordinates=com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST \ 95 | -Drewrite.activeRecipes=com.oracle.weblogic.rewrite.UpgradeTo1412 \ 96 | -Drewrite.exportDatatables=true 97 | ``` 98 | -------------------------------------------------------------------------------- /rewrite-weblogic/docs/recipes/migrate-to-weblogic-151100.md: -------------------------------------------------------------------------------- 1 | # Migrate to WebLogic 15.1.1 2 | **com.oracle.weblogic.rewrite.UpgradeTo1511** 3 | 4 | This recipe applies the changes required for migrating applications to WebLogic Server 15.1.1.0.0. 5 | 6 | ### Tags: 7 | - weblogic 8 | - java 9 | 10 | ### Recipe source 11 | 12 | [weblogic-15.1.1.yaml](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/weblogic-15.1.1.yaml) 13 | 14 | ### Recipe list: 15 | - com.oracle.weblogic.rewrite.OutputRecipeVersion 16 | - com.oracle.weblogic.rewrite.UpdateBuildToWebLogic1511 17 | - [com.oracle.weblogic.rewrite.CheckAndCommentOutDeprecations1511](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/weblogic-deprecations.yaml) 18 | - com.oracle.weblogic.rewrite.MigrateWebLogicSchemasTo1511 19 | - com.oracle.weblogic.rewrite.ChangeJakartaInjectAPIDependencyScope 20 | - com.oracle.weblogic.rewrite.ChangeJAXBBindAPIDependencyScope 21 | 22 | ### Usage 23 | 24 | This recipe will update the WebLogic version to 15.1.1 for the Maven build and comment out deprecated and removed APIs. 25 | 26 | **NOTE**: The UpgradeTo1511 recipe must be run **after** the Java and Jakarta recipes. 27 | 28 | #### Maven POM 29 | 30 | 1. Add the following to your Maven POM file. 31 | ``` 32 | 33 | org.openrewrite.maven 34 | rewrite-maven-plugin 35 | 6.3.1 36 | 37 | true 38 | 39 | com.oracle.weblogic.rewrite.UpgradeTo1511 40 | 41 | 42 | 43 | 44 | org.openrewrite.recipe 45 | rewrite-migrate-java 46 | 3.4.0 47 | 48 | 49 | com.oracle.weblogic.rewrite 50 | rewrite-weblogic 51 | [0.4.5,) 52 | 53 | 54 | 55 | ... 56 | ``` 57 | 2. Run `mvn rewrite:run` to run the recipe. 58 | 59 | > [!TIP] 60 | > If you just want to dry run the recipe without changing the code, use `mvn rewrite:DryRun`. For more details when using Maven, see [here](https://docs.openrewrite.org/reference/rewrite-maven-plugin). 61 | 62 | #### Gradle 63 | 64 | 1. Add the following to your `build.gradle` file: 65 | 66 | ``` 67 | plugins { 68 | id("org.openrewrite.rewrite") version("7.2.0") 69 | } 70 | 71 | rewrite { 72 | activeRecipe("com.oracle.weblogic.rewrite.UpgradeTo1511") 73 | setExportDatatables(true) 74 | } 75 | 76 | repositories { 77 | mavenCentral() 78 | } 79 | 80 | dependencies { 81 | rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.4.0") 82 | rewrite("com.oracle.weblogic.rewrite:rewrite-weblogic:+") 83 | } 84 | ``` 85 | 2. Run `gradle rewriteRun` to run the recipe. 86 | 87 | > [!TIP] 88 | > If you just want to dry run the recipe without changing the code, use `gradle rewriteDryRun`. For more details about the "dryRun" task, see [here](https://docs.openrewrite.org/reference/gradle-plugin-configuration#the-dryrun-task). 89 | 90 | #### Maven command line 91 | 92 | > [!NOTE] 93 | > You will need to have [Maven](https://maven.apache.org/download.cgi) installed on your machine before you can run the following command. 94 | 95 | ``` 96 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 97 | -Drewrite.recipeArtifactCoordinates=com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST \ 98 | -Drewrite.activeRecipes=com.oracle.weblogic.rewrite.UpgradeTo1511 \ 99 | -Drewrite.exportDatatables=true 100 | ``` 101 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/resources/META-INF/rewrite/hibernate.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. 3 | 4 | # Licensed under the Universal Permissive License v 1.0 as shown at 5 | # https://oss.oracle.com/licenses/upl. 6 | 7 | # Subject to the condition set forth below, permission is hereby granted to any 8 | # person obtaining a copy of this software, associated documentation and/or data 9 | # (collectively the "Software"), free of charge and under any and all copyright 10 | # rights in the Software, and any and all patent rights owned or freely 11 | # licensable by each licensor hereunder covering either (i) the unmodified 12 | # Software as contributed to or provided by such licensor, or (ii) the Larger 13 | # Works (as defined below), to deal in both 14 | 15 | # (a) the Software, and 16 | # (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | # one is included with the Software (each a "Larger Work" to which the Software 18 | # is contributed by such licensors), 19 | 20 | # without restriction, including without limitation the rights to copy, create 21 | # derivative works of, display, perform, and distribute the Software and make, 22 | # use, sell, offer for sale, import, export, have made, and have sold the 23 | # Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | # either these or other terms. 25 | 26 | # This license is subject to the following condition: 27 | # The above copyright notice and either this complete permission notice or at 28 | # a minimum a reference to the UPL must be included in all copies or 29 | # substantial portions of the Software. 30 | 31 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | # SOFTWARE. 38 | --- 39 | type: specs.openrewrite.org/v1beta/recipe 40 | name: com.oracle.weblogic.rewrite.hibernate.MigrateHibernateToJakartaEE9 41 | displayName: Migrate to Hibernate for Jakarta EE 9 42 | description: Upgrade hibernate libraries to Jakarta EE9 versions. 43 | tags: 44 | - jakarta 45 | - hibernate 46 | recipeList: 47 | - org.openrewrite.hibernate.MigrateToHibernate61 48 | - com.oracle.weblogic.rewrite.hibernate.AddHibernateOrmCore61 49 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion: 50 | groupId: org.hibernate.search 51 | artifactId: '*' 52 | newVersion: 6.2.x 53 | - org.openrewrite.java.dependencies.ChangeDependency: 54 | oldGroupId: org.hibernate 55 | oldArtifactId: hibernate-validator 56 | newGroupId: org.hibernate.validator 57 | newVersion: 7.0.x 58 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion: 59 | groupId: org.hibernate.validator 60 | artifactId: hibernate-validator 61 | newVersion: 7.0.x 62 | - org.openrewrite.java.dependencies.ChangeDependency: 63 | oldGroupId: org.hibernate 64 | oldArtifactId: hibernate-ehcache 65 | newGroupId: org.hibernate.orm 66 | newArtifactId: hibernate-jcache 67 | newVersion: 6.1.x 68 | --- 69 | type: specs.openrewrite.org/v1beta/recipe 70 | name: com.oracle.weblogic.rewrite.hibernate.AddHibernateOrmCore61 71 | displayName: Add Hibernate ORM Core if has dependencies 72 | description: This recipe will add Hibernate ORM Core if has dependencies. 73 | tags: 74 | - jakarta 75 | - hibernate 76 | - orm 77 | - core 78 | preconditions: 79 | - org.openrewrite.java.dependencies.DependencyInsight: 80 | groupIdPattern: org.hibernate* 81 | artifactIdPattern: hibernate-* 82 | recipeList: 83 | - org.openrewrite.java.dependencies.AddDependency: 84 | groupId: org.hibernate.orm 85 | artifactId: hibernate-core 86 | version: 6.1.x 87 | acceptTransitive: true -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/java/com/oracle/weblogic/rewrite/UpgradeWeblogicMavenPropertyVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Oracle and/or its affiliates. 3 | * 4 | * Licensed under the Universal Permissive License v 1.0 as shown at 5 | * https://oss.oracle.com/licenses/upl. 6 | * 7 | */ 8 | package com.oracle.weblogic.rewrite; 9 | 10 | import com.fasterxml.jackson.annotation.JsonCreator; 11 | import com.fasterxml.jackson.annotation.JsonProperty; 12 | import lombok.EqualsAndHashCode; 13 | import lombok.Value; 14 | import org.openrewrite.*; 15 | import org.openrewrite.marker.Markup; 16 | import org.openrewrite.maven.ChangePropertyValue; 17 | import org.openrewrite.maven.MavenIsoVisitor; 18 | import org.openrewrite.maven.tree.MavenResolutionResult; 19 | import org.openrewrite.semver.Semver; 20 | import org.openrewrite.xml.tree.Xml; 21 | 22 | import java.util.Optional; 23 | 24 | @Value 25 | @EqualsAndHashCode(callSuper = false) 26 | /** 27 | * A recipe to upgrade the `weblogic.version` Maven property. 28 | * This recipe updates the version of the `weblogic.version` property in the `pom.xml` 29 | * based on a specified version or a node-style semver selector. 30 | */ 31 | public class UpgradeWeblogicMavenPropertyVersion extends Recipe { 32 | 33 | /** 34 | * The new version to which the `weblogic.version` property should be updated. 35 | * This can be an exact version number or a semver selector. 36 | */ 37 | @Option(displayName = "New version", 38 | description = "An exact version number, or node-style semver selector used to select the version number.", 39 | example = "14.1.2-0-0") 40 | String newVersion; 41 | 42 | /** 43 | * Constructor for the `UpgradeWeblogicMavenPropertyVersion` recipe. 44 | * 45 | * @param newVersion The new version to which the `weblogic.version` property should be updated. 46 | */ 47 | @JsonCreator 48 | public UpgradeWeblogicMavenPropertyVersion(@JsonProperty("newVersion") String newVersion) { 49 | this.newVersion = newVersion; 50 | } 51 | 52 | @SuppressWarnings({ "unchecked", "rawtypes" }) 53 | @Override 54 | public Validated validate() { 55 | Validated validated = super.validate(); 56 | if (newVersion != null) { 57 | validated = validated.and(Semver.validate(newVersion, null)); 58 | } 59 | return validated; 60 | } 61 | 62 | @Override 63 | public String getDisplayName() { 64 | return "Upgrade `weblogic.version` Maven property"; 65 | } 66 | 67 | @Override 68 | public String getDescription() { 69 | return "Set the Maven weblogic.version property according to a node-style semver selector or to a specific version number."; 70 | } 71 | 72 | @Override 73 | public TreeVisitor getVisitor() { 74 | return new MavenIsoVisitor() { 75 | @Override 76 | public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) { 77 | Xml.Document d = super.visitDocument(document, ctx); 78 | MavenResolutionResult model = getResolutionResult(); 79 | String currentVersion = model.getPom().getProperties().get("weblogic.version"); 80 | 81 | if (currentVersion != null && !currentVersion.isEmpty()) { 82 | try { 83 | Optional latestVersion = WeblogicVersionHelper.getNewerVersion(newVersion, currentVersion, ctx); 84 | if (latestVersion.isPresent()) { 85 | System.out.printf("Upgrading weblogic.version from %s to %s%n", currentVersion, latestVersion.get()); 86 | doAfterVisit(new ChangePropertyValue("weblogic.version", latestVersion.get(), false, true).getVisitor()); 87 | } else { 88 | System.out.printf("No newer version found for weblogic.version: %s%n", currentVersion); 89 | } 90 | } catch (Exception e) { 91 | return Markup.warn(document, e); 92 | } 93 | } 94 | return d; 95 | } 96 | }; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /rewrite-weblogic/docs/recipes/migrate-to-spring-6_2.md: -------------------------------------------------------------------------------- 1 | # Migrate to Spring Framework 6.2 for WebLogic 15.1.1 2 | **com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2** 3 | 4 | This recipe migrates applications to the Spring Framework 6.2 release and to compatibility with WebLogic 15.1.1. 5 | 6 | ### Tags: 7 | - weblogic 8 | - springframework 9 | 10 | ### Recipe source 11 | 12 | [spring-framework-6.2.yaml](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/spring-framework-6.2.yaml) 13 | 14 | ### Recipe list: 15 | - org.openrewrite.java.spring.framework.UpgradeSpringFramework_6_1 16 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion:
17 | groupId: org.springframework
18 | artifactId: '*'
19 | newVersion: 6.2.x
20 | - com.oracle.weblogic.rewrite.spring.framework.DefaultServletHandler 21 | - com.oracle.weblogic.rewrite.spring.framework.ReplaceWebLogicJtaTransactionManager 22 | - com.oracle.weblogic.rewrite.spring.framework.ReplaceWebLogicLoadTimeWeaver 23 | - org.openrewrite.java.spring.data.UpgradeSpringData_2_7 24 | - com.oracle.weblogic.rewrite.spring.data.UpgradeSpringDataBom 25 | 26 | ### Usage 27 | 28 | This recipe will migrate applications to the Spring Framework 6.2 release and to compatibility with WebLogic 15.1.1. 29 | 30 | **NOTE**: This recipe is intended for migration from Spring Framework version 5.3 or later. We have not tested and we don’t support updating from earlier versions of Spring Framework. 31 | 32 | #### Maven POM 33 | 34 | 1. Add the following to your Maven POM file. 35 | ``` 36 | 37 | org.openrewrite.maven 38 | rewrite-maven-plugin 39 | 6.3.1 40 | 41 | true 42 | 43 | com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2 44 | 45 | 46 | 47 | 48 | org.openrewrite.recipe 49 | rewrite-migrate-java 50 | 3.4.0 51 | 52 | 53 | com.oracle.weblogic.rewrite 54 | rewrite-weblogic 55 | [0.4.5,) 56 | 57 | 58 | 59 | ... 60 | ``` 61 | 2. Run `mvn rewrite:run` to run the recipe. 62 | 63 | > [!TIP] 64 | > If you just want to dry run the recipe without changing the code, use `mvn rewrite:DryRun`. For more details when using Maven, see [here](https://docs.openrewrite.org/reference/rewrite-maven-plugin). 65 | 66 | #### Gradle 67 | 68 | 1. Add the following to your `build.gradle` file: 69 | 70 | ``` 71 | plugins { 72 | id("org.openrewrite.rewrite") version("7.1.4") 73 | } 74 | 75 | rewrite { 76 | activeRecipe("com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2") 77 | setExportDatatables(true) 78 | } 79 | 80 | repositories { 81 | mavenCentral() 82 | } 83 | 84 | dependencies { 85 | rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.2.0") 86 | rewrite("com.oracle.weblogic.rewrite:rewrite-weblogic:+") 87 | } 88 | ``` 89 | 2. Run `gradle rewriteRun` to run the recipe. 90 | 91 | > [!TIP] 92 | > If you just want to dry run the recipe without changing the code, use `gradle rewriteDryRun`. For more details about the "dryRun" task, see [here](https://docs.openrewrite.org/reference/gradle-plugin-configuration#the-dryrun-task). 93 | 94 | #### Maven command line 95 | 96 | > [!NOTE] 97 | > You will need to have [Maven](https://maven.apache.org/download.cgi) installed on your machine before you can run the following command. 98 | 99 | ``` 100 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 101 | -Drewrite.recipeArtifactCoordinates=com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST,org.openrewrite.recipe:rewrite-spring:RELEASE \ 102 | -Drewrite.activeRecipes=com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2 \ 103 | -Drewrite.exportDatatables=true 104 | ``` 105 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/test/java/com/oracle/weblogic/rewrite/UpgradeWeblogicMavenPropertyVersionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Oracle and/or its affiliates. 3 | * 4 | * Licensed under the Universal Permissive License v 1.0 as shown at 5 | * https://oss.oracle.com/licenses/upl. 6 | * 7 | */ 8 | package com.oracle.weblogic.rewrite; 9 | 10 | import org.junit.jupiter.api.Test; 11 | import org.openrewrite.DocumentExample; 12 | import org.openrewrite.test.RewriteTest; 13 | 14 | import static org.openrewrite.maven.Assertions.pomXml; 15 | 16 | class UpgradeWeblogicMavenPropertyVersionTest implements RewriteTest { 17 | 18 | @DocumentExample 19 | @Test 20 | void changeMavenWeblogicVersion1411() { 21 | String latestWeblogicVersion = WeblogicRewriteTestVersions.getLatestWLS1411Version(); 22 | 23 | rewriteRun(spec -> spec.recipe(new UpgradeWeblogicMavenPropertyVersion("14.1.1-0-0")), 24 | //language=xml 25 | pomXml( 26 | """ 27 | 28 | 4.0.0 29 | com.mycompany.app 30 | my-app 31 | 1 32 | 33 | 12.1.3-0-0 34 | 35 | 36 | """, 37 | """ 38 | 39 | 4.0.0 40 | com.mycompany.app 41 | my-app 42 | 1 43 | 44 | %s 45 | 46 | 47 | """.formatted(latestWeblogicVersion)) 48 | ); 49 | } 50 | 51 | @Test 52 | void changeMavenWeblogicVersion1412() { 53 | String latestWeblogicVersion = WeblogicRewriteTestVersions.getLatestWLS1412Version(); 54 | 55 | rewriteRun(spec -> spec.recipe(new UpgradeWeblogicMavenPropertyVersion("14.1.2-0-0")), 56 | //language=xml 57 | pomXml( 58 | """ 59 | 60 | 4.0.0 61 | com.mycompany.app 62 | my-app 63 | 1 64 | 65 | 12.1.3-0-0 66 | 67 | 68 | """, 69 | """ 70 | 71 | 4.0.0 72 | com.mycompany.app 73 | my-app 74 | 1 75 | 76 | %s 77 | 78 | 79 | """.formatted(latestWeblogicVersion)) 80 | ); 81 | } 82 | 83 | @Test 84 | void changeMavenWeblogicVersion1511() { 85 | String latestWeblogicVersion = WeblogicRewriteTestVersions.getLatestWLS1511Version(); 86 | 87 | rewriteRun(spec -> spec.recipe(new UpgradeWeblogicMavenPropertyVersion("15.1.1-0-0")), 88 | //language=xml 89 | pomXml( 90 | """ 91 | 92 | 4.0.0 93 | com.mycompany.app 94 | my-app 95 | 1 96 | 97 | 14.1.2-0-0 98 | 99 | 100 | """, 101 | """ 102 | 103 | 4.0.0 104 | com.mycompany.app 105 | my-app 106 | 1 107 | 108 | %s 109 | 110 | 111 | """.formatted(latestWeblogicVersion)) 112 | ); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /rewrite-weblogic/docs/recipes/migrate-to-jakarta-EE-9_1.md: -------------------------------------------------------------------------------- 1 | # Migrate to Jakarta EE 9.1 2 | **com.oracle.weblogic.rewrite.JakartaEE9_1** 3 | 4 | This recipe applies the changes required for migrating to Jakarta EE 9.1, flagging and updating deprecated methods. 5 | 6 | ### Tags: 7 | - weblogic 8 | - jakarta 9 | - jakartaee 10 | - migration 11 | 12 | ### Recipe source 13 | 14 | [jakarta-ee-9.1.yaml](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/jakarta-ee-9.1.yaml) 15 | 16 | ### Recipe list: 17 | - org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta 18 | - [com.oracle.weblogic.rewrite.jakarta.Faces2xMigrationToJakartaFaces3x](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/jakarta-faces-3.yaml) 19 | - [com.oracle.weblogic.rewrite.jakarta.JakartaEeNamespaces9_1](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/jakarta-ee-9.1-namespaces.yaml) 20 | - com.oracle.weblogic.rewrite.jakarta.RemovalsServletJakarta9 21 | - com.oracle.weblogic.rewrite.jakarta.JavaxToJakartaCdiExtensions 22 | - com.oracle.weblogic.rewrite.jakarta.MigrateTagLibsToJakartaEE9 23 | - com.oracle.weblogic.rewrite.jakarta.AddJakartaEE9ServletDependencyIfUsingServletContext 24 | - com.oracle.weblogic.rewrite.jakarta.MigrateJavaxMVCToJakartaEE9 25 | - com.oracle.weblogic.rewrite.jakarta.MigrateJavaxWebToJakartaWeb9 26 | - com.oracle.weblogic.rewrite.jakarta.JavaxAnnotationMigrationToJakarta9Annotation 27 | - com.oracle.weblogic.rewrite.jakarta.OrgGlassfishJavaxElToJakartaEl 28 | - com.oracle.weblogic.rewrite.jakarta.JavaxJmsToJakartaJmsOnMdb 29 | - com.oracle.weblogic.rewrite.jakarta.UpdateJakartaPlatform9_1 30 | - com.oracle.weblogic.rewrite.jakarta.MitigateUnaffectedNonEEJakarta9Packages 31 | - com.oracle.weblogic.rewrite.jakarta.UpgradeCommonOpenSourceLibraries 32 | 33 | ### Usage 34 | 35 | This recipe will update Jakarta EE platform dependencies to 9.1.0, and flag and update deprecated methods. 36 | 37 | #### Maven POM 38 | 39 | 1. Add the following to your Maven POM file. 40 | ``` 41 | 42 | org.openrewrite.maven 43 | rewrite-maven-plugin 44 | 6.3.1 45 | 46 | true 47 | 48 | com.oracle.weblogic.rewrite.JakartaEE9_1 49 | 50 | 51 | 52 | 53 | org.openrewrite.recipe 54 | rewrite-migrate-java 55 | 3.4.0 56 | 57 | 58 | com.oracle.weblogic.rewrite 59 | rewrite-weblogic 60 | [0.4.5,) 61 | 62 | 63 | 64 | ... 65 | ``` 66 | 2. Run `mvn rewrite:run` to run the recipe. 67 | 68 | > [!TIP] 69 | > If you just want to dry run the recipe without changing the code, use `mvn rewrite:DryRun`. For more details when using Maven, see [here](https://docs.openrewrite.org/reference/rewrite-maven-plugin). 70 | 71 | #### Gradle 72 | 73 | 1. Add the following to your `build.gradle` file: 74 | 75 | ``` 76 | plugins { 77 | id("org.openrewrite.rewrite") version("7.1.4") 78 | } 79 | 80 | rewrite { 81 | activeRecipe("com.oracle.weblogic.rewrite.JakartaEE9_1") 82 | setExportDatatables(true) 83 | } 84 | 85 | repositories { 86 | mavenCentral() 87 | } 88 | 89 | dependencies { 90 | rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.2.0") 91 | rewrite("com.oracle.weblogic.rewrite:rewrite-weblogic:+") 92 | } 93 | ``` 94 | 2. Run `gradle rewriteRun` to run the recipe. 95 | 96 | > [!TIP] 97 | > If you just want to dry run the recipe without changing the code, use `gradle rewriteDryRun`. For more details about the "dryRun" task, see [here](https://docs.openrewrite.org/reference/gradle-plugin-configuration#the-dryrun-task). 98 | 99 | #### Maven command line 100 | 101 | > [!NOTE] 102 | > You will need to have [Maven](https://maven.apache.org/download.cgi) installed on your machine before you can run the following command. 103 | 104 | ``` 105 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 106 | -Drewrite.recipeArtifactCoordinates=com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST,org.openrewrite.recipe:rewrite-migrate-java:RELEASE \ 107 | -Drewrite.activeRecipes=com.oracle.weblogic.rewrite.JakartaEE9_1 \ 108 | -Drewrite.exportDatatables=true 109 | ``` 110 | -------------------------------------------------------------------------------- /rewrite-weblogic/docs/procedures/upgrade-151100.md: -------------------------------------------------------------------------------- 1 | # Upgrade to WebLogic Server 15.1.1 2 | 3 | The following procedure will apply the changes required for migrating applications to WebLogic Server 15.1.1.0.0 and Jakarta EE 9.1. 4 | 5 | ## Prerequisites 6 | 7 | The following is required to build and run this project: 8 | 9 | - JDK - For migration, version 17 or later; post-migration, you need the target JDK installed. 10 | - Maven (minimum version 3.6, with recommended version, 3.9.9) or Gradle (version 4.0+) 11 | - Your code 12 | 13 | ## Get your code 14 | 15 | Clone your project to your local machine. 16 | 17 | > [!IMPORTANT] 18 | > Note that the `run` command will make changes to your code. Always make sure you have a backup of your code. When using git, create a branch and use `git diff` to see the differences. 19 | 20 | # Examples 21 | 22 | The following example sections illustrate the methods for upgrading your applications to WebLogic 15.1.1 and Jakarta EE 9.1. 23 | 24 | You can run OpenRewrite recipes on your code folder using the Maven or Gradle CLI, or include them as a build plug-in in your `pom.xml` or `build.gradle` file. 25 | 26 | ## Run using the Maven CLI 27 | 28 | > [!NOTE] 29 | > You will need to have [Maven](https://maven.apache.org/download.cgi) installed on your machine before you can run the following command. 30 | 31 | For OpenRewrite to run, Maven dependencies must be resolved. If needed, run `mvn clean install` for missing dependencies. 32 | 33 | 1. Open a terminal at the root of the project and run: 34 | 35 | ```shell 36 | mvn clean install 37 | ``` 38 | 39 | Or, you can use other commands, such as `mvn dependency:resolve`. 40 | 41 | 2. Run the following Maven command to run OpenRewrite: 42 | 43 | ``` 44 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 45 | -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE,com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST \ 46 | -Drewrite.activeRecipes=com.oracle.weblogic.rewrite.JakartaEE9_1,com.oracle.weblogic.rewrite.UpgradeTo1511 47 | ``` 48 | 49 | > [!NOTE] 50 | > When upgrading to WebLogic Server 15.1.1, the `UpgradeTo1511` recipe must be run _after_ the Java and Jakarta recipes. 51 | 52 | ## Run using Maven with the `` in the `pom.xml` file 53 | 54 | 1. Add the plug-in to your `pom.xml` file and activate the recipes. The following example illustrates the Upgrade to WebLogic 15.1.1 recipe. 55 | 56 | ``` 57 | 58 | org.openrewrite.maven 59 | rewrite-maven-plugin 60 | 6.31 61 | 62 | true 63 | 64 | com.oracle.weblogic.rewrite.UpgradeTo1511 65 | 66 | 67 | 68 | 69 | org.openrewrite.recipe 70 | rewrite-migrate-java 71 | 3.4.0 72 | 73 | 74 | com.oracle.weblogic.rewrite 75 | rewrite-weblogic 76 | [0.4.5,) 77 | 78 | 79 | 80 | ... 81 | ``` 82 | 83 | 2. To run the recipe: `mvn rewrite:run` 84 | 85 | > [!TIP] 86 | > If you just want to dry run the recipe without changing the code, use `mvn rewrite:DryRun`. For more details when using Maven, see [here](https://docs.openrewrite.org/reference/rewrite-maven-plugin). 87 | 88 | ### Run using Gradle 89 | 90 | 1. Add the following to your `build.gradle` file: 91 | 92 | ``` 93 | plugins { 94 | id("org.openrewrite.rewrite") version("7.2.0") 95 | } 96 | 97 | rewrite { 98 | activeRecipe("com.oracle.weblogic.rewrite.UpgradeTo1511") 99 | setExportDatatables(true) 100 | } 101 | 102 | repositories { 103 | mavenCentral() 104 | } 105 | 106 | dependencies { 107 | rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.4.0") 108 | rewrite("com.oracle.weblogic.rewrite:rewrite-weblogic:+") 109 | } 110 | ``` 111 | 2. Run `gradle rewriteRun` to run the recipe. 112 | 113 | > [!TIP] 114 | > If you just want to dry run the recipe without changing the code, use `gradle rewriteDryRun`. For more details about the "dryRun" task, see [here](https://docs.openrewrite.org/reference/gradle-plugin-configuration#the-dryrun-task). 115 | 116 | > [!NOTE] 117 | > You can run Rewrite on a Gradle project without modifying the build, similar to using the `mvn` CLI command. For more information, see https://docs.openrewrite.org/running-recipes/running-rewrite-on-a-gradle-project-without-modifying-the-build. 118 | -------------------------------------------------------------------------------- /rewrite-weblogic/docs/procedures/upgrade-141200.md: -------------------------------------------------------------------------------- 1 | # Upgrade to WebLogic Server 14.1.2 2 | 3 | The following procedures will upgrade your applications to WebLogic 14.1.2 and Java 21, and comment out deprecated and removed APIs. 4 | 5 | ## Prerequisites 6 | 7 | The following is required to build and run this project: 8 | 9 | - JDK - For migration, version 17 or later; post-migration, you need the target JDK installed. 10 | - Maven (minimum version 3.6, with recommended version, 3.9.9) or Gradle (version 4.0+) 11 | - Your code 12 | 13 | ## Get your code 14 | 15 | Clone your project to your local machine. 16 | 17 | > [!IMPORTANT] 18 | > Note that the `run` command will make changes to your code. Always make sure you have a backup of your code. When using git, create a branch and use `git diff` to see the differences. 19 | 20 | # Examples 21 | 22 | The following example sections illustrate the methods for upgrading your applications to WebLogic 14.1.2 and Java 21. 23 | 24 | You can run OpenRewrite recipes on your code folder using the Maven or Gradle CLI, or include them as a build plug-in in your `pom.xml` or `build.gradle` file. 25 | 26 | ## Run using the Maven CLI 27 | 28 | > [!NOTE] 29 | > You will need to have [Maven](https://maven.apache.org/download.cgi) installed on your machine before you can run the following command. 30 | 31 | For OpenRewrite to run, Maven dependencies must be resolved. If needed, run `mvn clean install` for missing dependencies. 32 | 33 | 1. Open a terminal at the root of the project and run: 34 | 35 | ```shell 36 | mvn clean install 37 | ``` 38 | 39 | Or, you can use other commands, such as `mvn dependency:resolve`. 40 | 41 | 2. Run the following Maven command to run OpenRewrite: 42 | 43 | > [!NOTE] 44 | > The `UpgradeTo1412` recipe must be run _after_ the Java recipe. 45 | ``` 46 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 47 | -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE,com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST \ 48 | -Drewrite.activeRecipes=org.openrewrite.java.migrate.UpgradeToJava21,com.oracle.weblogic.rewrite.UpgradeTo1412 49 | ``` 50 | 51 | ## Run using Maven with the `` in the `pom.xml` file 52 | 53 | 1. Add the plug-in to your `pom.xml` file and activate the recipes. The following example illustrates the Upgrade to WebLogic 14.1.2 and Upgrade to Java 21 recipes. 54 | 55 | ``` 56 | 57 | org.openrewrite.maven 58 | rewrite-maven-plugin 59 | 6.3.1 60 | 61 | true 62 | 63 | org.openrewrite.java.migrate.UpgradeToJava21 64 | com.oracle.weblogic.rewrite.UpgradeTo1412 65 | 66 | 67 | 68 | 69 | org.openrewrite.recipe 70 | rewrite-migrate-java 71 | 3.4.0 72 | 73 | 74 | com.oracle.weblogic.rewrite 75 | rewrite-weblogic 76 | [0.4.5,) 77 | 78 | 79 | 80 | ``` 81 | 82 | 2. To run the recipe: `mvn rewrite:run` 83 | 84 | > [!TIP] 85 | > If you just want to dry run the recipe without changing the code, use `mvn rewrite:DryRun`. For more details when using Maven, see [here](https://docs.openrewrite.org/reference/rewrite-maven-plugin). 86 | 87 | ### Run using Gradle 88 | 89 | 1. Add the following to your `build.gradle` file: 90 | 91 | ``` 92 | plugins { 93 | id("org.openrewrite.rewrite") version("7.2.0") 94 | } 95 | 96 | rewrite { 97 | activeRecipe("org.openrewrite.java.migrate.UpgradeToJava21") 98 | activeRecipe("com.oracle.weblogic.rewrite.UpgradeTo1412") 99 | setExportDatatables(true) 100 | } 101 | 102 | repositories { 103 | mavenCentral() 104 | } 105 | 106 | dependencies { 107 | rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.4.0") 108 | rewrite("com.oracle.weblogic.rewrite:rewrite-weblogic:+") 109 | } 110 | ``` 111 | 2. Run `gradle rewriteRun` to run the recipe. 112 | 113 | > [!TIP] 114 | > If you just want to dry run the recipe without changing the code, use `gradle rewriteDryRun`. For more details about the "dryRun" task, see [here](https://docs.openrewrite.org/reference/gradle-plugin-configuration#the-dryrun-task). 115 | 116 | > [!NOTE] 117 | > You can run Rewrite on a Gradle project without modifying the build, similar to using the `mvn` CLI command. For more information, see https://docs.openrewrite.org/running-recipes/running-rewrite-on-a-gradle-project-without-modifying-the-build. 118 | -------------------------------------------------------------------------------- /rewrite-weblogic/docs/recipes/migrate-to-weblogic-141100.md: -------------------------------------------------------------------------------- 1 | # Migrate to WebLogic 14.1.1 2 | **com.oracle.weblogic.rewrite.UpgradeTo1411** 3 | 4 | These recipes apply the changes required for upgrading to WebLogic Server 14.1.1.0.0 and for upgrading from Java 8 to Java 11. 5 | 6 | ### Tags: 7 | - weblogic 8 | - java 9 | 10 | ### Recipe source 11 | 12 | [weblogic-14.1.1.yaml](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/weblogic-14.1.1.yaml) 13 | 14 | ### Recipe list: 15 | - org.openrewrite.java.migrate.Java8toJava11 16 | - org.openrewrite.maven.ChangePropertyValue:
17 | key: weblogic.version
18 | newValue: 14.1.1-0-0
19 | - org.openrewrite.maven.UpgradeParentVersion:
20 | groupId: com.oracle.weblogic.archetype
21 | artifactId: wls-common
22 | newVersion: 14.1.1-0-0
23 | - org.openrewrite.maven.UpgradePluginVersion:
24 | groupId: com.oracle.weblogic
25 | artifactId: org.glassfish.javax.json
26 | newVersion: 14.1.1-0-0
27 | trustParent: "True"
28 | - org.openrewrite.maven.UpgradePluginVersion:
29 | groupId: com.oracle.weblogic
30 | artifactId: javax.javaee-api
31 | newVersion: 14.1.1-0-0
32 | trustParent: "True"
33 | - org.openrewrite.maven.UpgradePluginVersion:
34 | groupId: com.oracle.weblogic
35 | artifactId: org.codehaus.jettison.jettison
36 | newVersion: 14.1.1-0-0
37 | trustParent: "True"
38 | - org.openrewrite.maven.UpgradePluginVersion:
39 | groupId: com.oracle.weblogic
40 | artifactId: javax.javaee-api
41 | newVersion: 14.1.1-0-0
42 | trustParent: "True"
43 | 44 | ### Usage 45 | 46 | These recipes will update the WebLogic version to 14.1.1 for the Maven build and will apply changes commonly needed when upgrading to Java 11. Specifically, for those applications that are built on Java 8, the recipe will update and add dependencies on Java EE libraries that are no longer directly bundled with the JDK and will also replace deprecated API with equivalents when there is a clear migration strategy. 47 | 48 | #### Maven POM 49 | 50 | 1. Add the following to your Maven POM file. 51 | ``` 52 | 53 | org.openrewrite.maven 54 | rewrite-maven-plugin 55 | 6.3.1 56 | 57 | true 58 | 59 | org.openrewrite.java.migrate.Java8toJava11 60 | com.oracle.weblogic.rewrite.UpgradeTo1411 61 | 62 | 63 | 64 | 65 | org.openrewrite.recipe 66 | rewrite-migrate-java 67 | 3.4.0 68 | 69 | 70 | com.oracle.weblogic.rewrite 71 | rewrite-weblogic 72 | [0.4.5,) 73 | 74 | 75 | 76 | ... 77 | ``` 78 | 2. Run `mvn rewrite:run` to run the recipe. 79 | 80 | > [!TIP] 81 | > If you just want to dry run the recipe without changing the code, use `mvn rewrite:DryRun`. For more details when using Maven, see [here](https://docs.openrewrite.org/reference/rewrite-maven-plugin). 82 | 83 | #### Gradle 84 | 85 | 1. Add the following to your `build.gradle` file: 86 | 87 | ``` 88 | plugins { 89 | id("org.openrewrite.rewrite") version("7.2.0") 90 | } 91 | 92 | rewrite { 93 | activeRecipe("org.openrewrite.java.migrate.Java8toJava11") 94 | activeRecipe("com.oracle.weblogic.rewrite.UpgradeTo1411") 95 | setExportDatatables(true) 96 | } 97 | 98 | repositories { 99 | mavenCentral() 100 | } 101 | 102 | dependencies { 103 | rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.4.0") 104 | rewrite("com.oracle.weblogic.rewrite:rewrite-weblogic:+") 105 | } 106 | ``` 107 | 2. Run `gradle rewriteRun` to run the recipe. 108 | 109 | > [!TIP] 110 | > If you just want to dry run the recipe without changing the code, use `gradle rewriteDryRun`. For more details about the "dryRun" task, see [here](https://docs.openrewrite.org/reference/gradle-plugin-configuration#the-dryrun-task). 111 | 112 | 113 | #### Maven command line 114 | 115 | > [!NOTE] 116 | > You will need to have [Maven](https://maven.apache.org/download.cgi) installed on your machine before you can run the following command. 117 | 118 | ``` 119 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 120 | -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE,com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST \ 121 | -Drewrite.activeRecipes=org.openrewrite.java.migrate.Java8toJava11,com.oracle.weblogic.rewrite.UpgradeTo1411 \ 122 | -Drewrite.exportDatatables=true 123 | ``` 124 | -------------------------------------------------------------------------------- /rewrite-weblogic/docs/concepts/README.md: -------------------------------------------------------------------------------- 1 | # What is WebLogic Server application upgrade tooling? 2 | 3 | WebLogic Server application upgrade tooling employs [Rewrite WebLogic](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/README.md#recipes) recipes that perform the functions you need to successfully upgrade your applications. Rewrite WebLogic recipes automate application upgrades, such as the changes needed for WebLogic version upgrades, JDK upgrades, Jakarta EE upgrades, and Spring Framework upgrades. Application upgrades can be complex. By using automated code updates, you reduce the risk of human error. 4 | 5 | Rewrite WebLogic is part of a larger, [OpenRewrite](https://github.com/openrewrite/rewrite) project, a popular open source code refactoring automation framework. There you'll find lots of community recipes, recipes that are customizable and extensible for your own use. Recipes from Oracle are supported by Oracle. 6 | 7 | ## How it works 8 | 9 | [OpenRewrite](https://docs.openrewrite.org/) scans your source code and builds an in-memory [Lossless Semantic Tree](https://docs.openrewrite.org/concepts-and-explanations/lossless-semantic-trees) (LST) representation of all of the application structures. LSTs offer a unique set of characteristics that make it possible to perform accurate transformations and searches across a repository. 10 | 11 | OpenRewite employs an auto-refactoring engine that works by making changes to the LSTs that represent your source code. Each LST retains the required information and formatting of your original code. The application code refactoring logic is stored in recipes. Transformation by OpenRewrite recipes makes changes to the LSTs, and then the modified LSTs are used to regenerate the changed code. The formatting is preserved; the whitespace is preserved. You can review the changes to your code and, if satisfied, commit the results. 12 | 13 | ## About recipes 14 | 15 | OpenRewrite [recipes](https://docs.openrewrite.org/concepts-and-explanations/recipes) comprise search and refactoring operations that can be applied to LSTs. A recipe can represent a single, standalone operation or it can be linked together with other recipes to accomplish a larger goal. WebLogic Rewrite recipes are composite recipes (recipes that consist of a list of other recipes). Recipes can be further composable - that is, a composite recipe can include composite recipes. In addition, recipes are stackable meaning that you can run more than one recipe at a time, within a single command or Maven configuration. 16 | 17 | The rewrite process driven by Maven or Gradle. You call [Rewrite WebLogic recipes](../../docs/recipes/README.md) on your code folder using the Maven or Gradle CLI, or by including them as a build plug-in in your `pom.xml` file. Recipes are activated, marked as `activeRecipes`, on the command line or in the `pom.xml` or `build.gradle` file, then you trigger running the activated recipe with the appropriate Maven or Gradle `run` command. 18 | 19 | For example: 20 | ``` 21 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ <- Command to launch OpenRewrite tool 22 | 23 | -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE,com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST \ <- Recipe dependencies 24 | 25 | -Drewrite.activeRecipes=,org.openrewrite.java.migrate.UpgradeToJava21,com.oracle.weblogic.rewrite.JakartaEE9_1,com.oracle.weblogic.rewrite.UpgradeTo1511 \ <- Recipe list 26 | -Drewrite.exportDatatables=true \ <- Optional entry to generate csv of what is changed 27 | ``` 28 | For more information, see [How to run recipes](../../docs/procedures/README.md). 29 | 30 | ## Troubleshooting 31 | 32 | Here are some issues associated with OpenRewrite recipes that you may encounter in the WebLogic Server 15.1.1.0.0 release. 33 | 34 | **Issue**
35 | WebLogic OpenRewrite recipes do not support the transformation of descriptors that use DTD references. 36 | 37 | 38 | **Issue**
39 | To migrate Spring Framework applications to WebLogic Server version 15.1.1.0.0 and Jakarta EE 9.1, using either JDK17 or JDK21, you should have: 40 | * Spring Framework version 5.3 or later. We have not tested and we don’t support updating from earlier versions of Spring Framework. 41 | * A supported Hibernate version for Jakarta EE 9.1. Make sure that the Spring Framework application compiles and runs. 42 | * Run both Hibernate and Spring recipes together. 43 | 44 | 45 | **Issue**
46 | For application migration to be successful, all dependencies, including fourth-party dependencies, must be included in the `pom.xml` file, _before_ migration. 47 | 48 | 49 | **Issue**
50 | The `weblogic open-rewrite` command fails to run on a multi-module Maven project when dependent modules are delayed in running. The issue is solved by specifying the module dependencies using the `--projects` option. For example: 51 | ``` 52 | mvn -U 53 | ... 54 | --projects --also-make 55 | ``` 56 | For more information, see the [Guide to Working with Multiple Subprojects in Maven 4](https://maven.apache.org/guides/mini/guide-multiple-subprojects-4.html). 57 | 58 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/test/java/com/oracle/weblogic/rewrite/jakarta/ChangeJakartaFacesMethodCallsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 Oracle and/or its affiliates. 3 | * 4 | * Licensed under the Universal Permissive License v 1.0 as shown at 5 | * https://oss.oracle.com/licenses/upl. 6 | * 7 | */ 8 | package com.oracle.weblogic.rewrite.jakarta; 9 | 10 | import org.junit.jupiter.api.Test; 11 | import org.openrewrite.java.JavaParser; 12 | import org.openrewrite.test.RecipeSpec; 13 | import org.openrewrite.test.RewriteTest; 14 | import org.openrewrite.test.TypeValidation; 15 | 16 | import static org.openrewrite.java.Assertions.java; 17 | 18 | public class ChangeJakartaFacesMethodCallsTest implements RewriteTest { 19 | private static final String JAKARTA_EE9_API_JAR_NAME = "jakarta.jakartaee-api"; 20 | private static final String JAKARTA_WEBAPI9_JAR_NAME = "jakarta.jakartaee-web-api"; 21 | @Override 22 | public void defaults(RecipeSpec spec) { 23 | try { 24 | spec.parser(JavaParser.fromJavaVersion() 25 | .classpath(JAKARTA_EE9_API_JAR_NAME, JAKARTA_WEBAPI9_JAR_NAME)) 26 | .recipe(new ChangeJakartaFacesMethodCalls()) 27 | // the code provided for the "before" case is after partial transformation by other Rewrite recipes, 28 | // before it gets to this recipe. That code is not expected to compile, so we skip type validations. 29 | .typeValidationOptions(TypeValidation.none()); 30 | } catch (Throwable e) { 31 | throw new RuntimeException(e); 32 | } 33 | } 34 | 35 | @Test 36 | public void testValueExpressionAndBinding() { 37 | rewriteRun( 38 | java( 39 | """ 40 | package com.mypackage; 41 | 42 | import jakarta.el.ValueExpression; 43 | import jakarta.faces.application.Application; 44 | import jakarta.faces.context.FacesContext; 45 | 46 | public class MyClass { 47 | public void getStockNews() { 48 | FacesContext facesContext = FacesContext.getCurrentInstance(); 49 | Application application = facesContext.getApplication(); 50 | ValueExpression binding = application.createValueBinding("#{stockTickerBeanVal}"); 51 | Object b = binding.getValue(facesContext); 52 | } 53 | } 54 | """, 55 | """ 56 | package com.mypackage; 57 | 58 | import jakarta.el.ValueExpression; 59 | import jakarta.faces.application.Application; 60 | import jakarta.faces.context.FacesContext; 61 | 62 | public class MyClass { 63 | public void getStockNews() { 64 | FacesContext facesContext = FacesContext.getCurrentInstance(); 65 | Application application = facesContext.getApplication(); 66 | ValueExpression binding = application.getExpressionFactory().createValueExpression(FacesContext.getCurrentInstance().getELContext(), "#{stockTickerBeanVal}", Object.class); 67 | Object b = binding.getValue(facesContext.getELContext()); 68 | } 69 | } 70 | """) 71 | ); 72 | } 73 | 74 | /** 75 | * Test a case that has references to other methods which have the same name as the ones the recipe matches for, 76 | * but not on the same data types. These should not match and there should be no change to the code. 77 | */ 78 | @Test 79 | public void testShouldNotMakeChanges() { 80 | rewriteRun(java( 81 | """ 82 | package com.mypackage; 83 | 84 | public class MyClass { 85 | public void getStockNews() { 86 | Application application = new Application(); 87 | ValueExpression ve = application.createValueBinding("#{stockTickerBeanVal}"); 88 | String s = ve.getValue(); 89 | } 90 | } 91 | 92 | class Application { 93 | public ValueExpression createValueBinding(String val) { 94 | return new ValueExpression("dummy return value"); 95 | } 96 | } 97 | 98 | class ValueExpression { 99 | private String value; 100 | public ValueExpression(String value) { 101 | this.value = value; 102 | } 103 | public String getValue() { 104 | return this.value; 105 | } 106 | } 107 | """ 108 | )); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/resources/META-INF/rewrite/spring-framework-6.2.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2025 the original author or authors. 3 | #

4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | #

8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | #

10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | --- 17 | type: specs.openrewrite.org/v1beta/recipe 18 | name: com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2 19 | displayName: Migrate to Spring Framework 6.2 for WebLogic 15.1.1 20 | description: Migrate applications to the Spring Framework 6.2 release and compatibility with WebLogic 15.1.1. 21 | tags: 22 | - springframework 23 | - weblogic 24 | recipeList: 25 | - org.openrewrite.java.spring.framework.UpgradeSpringFramework_6_1 26 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion: 27 | groupId: org.springframework 28 | artifactId: '*' 29 | newVersion: 6.2.x 30 | - com.oracle.weblogic.rewrite.spring.framework.DefaultServletHandler 31 | - com.oracle.weblogic.rewrite.spring.framework.ReplaceWebLogicJtaTransactionManager 32 | - com.oracle.weblogic.rewrite.spring.framework.ReplaceWebLogicLoadTimeWeaver 33 | - org.openrewrite.java.spring.data.UpgradeSpringData_2_7 34 | - com.oracle.weblogic.rewrite.spring.data.UpgradeSpringDataBom 35 | - com.oracle.weblogic.rewrite.spring.data.UpgradeSpringDataJpa 36 | --- 37 | type: specs.openrewrite.org/v1beta/recipe 38 | name: com.oracle.weblogic.rewrite.spring.framework.DefaultServletHandler 39 | displayName: Update Default Servlet Handler for Spring Framework if empty 40 | description: This recipe will update Spring Framework default servlet handler if empty, as noted in the Spring Framework 6.2 [documentation](https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-config/default-servlet-handler.html). 41 | tags: 42 | - springframework 43 | - weblogic 44 | - default-servlet-handler 45 | preconditions: 46 | - org.openrewrite.FindSourceFiles: 47 | filePattern: '**/mvc-core-config.xml' 48 | - org.openrewrite.xml.search.FindTags: 49 | xPath: //beans/mvc:default-servlet-handler[not(@default-servlet-name)] 50 | recipeList: 51 | - org.openrewrite.xml.RemoveXmlTag: 52 | xPath: //beans/mvc:default-servlet-handler[not(@default-servlet-name)] 53 | - org.openrewrite.xml.AddOrUpdateChildTag: 54 | parentXPath: //beans 55 | newChildTag: | 56 | 57 | --- 58 | type: specs.openrewrite.org/v1beta/recipe 59 | name: com.oracle.weblogic.rewrite.spring.framework.ReplaceWebLogicJtaTransactionManager 60 | displayName: Replace Removed WebLogicJtaTransactionManager from Spring Framework 5.3.x to 6.2.x 61 | description: Replace removed WebLogicJtaTransactionManager with JtaTransactionManager from Spring Framework 6.2.x. 62 | tags: 63 | - springframework 64 | - weblogic 65 | - JtaTransactionManager 66 | recipeList: 67 | - org.openrewrite.java.ChangeType: 68 | oldFullyQualifiedTypeName: org.springframework.transaction.jta.WebLogicJtaTransactionManager 69 | newFullyQualifiedTypeName: org.springframework.transaction.jta.JtaTransactionManager 70 | - org.openrewrite.java.RemoveMethodInvocations: 71 | methodPattern: org.springframework.transaction.jta.* loadWebLogicTransactionClasses() 72 | - org.openrewrite.java.RemoveMethodInvocations: 73 | methodPattern: org.springframework.transaction.jta.* loadWebLogicTransactionHelper() 74 | - org.openrewrite.java.RemoveMethodInvocations: 75 | methodPattern: org.springframework.transaction.jta.* obtainTransactionManager() 76 | --- 77 | type: specs.openrewrite.org/v1beta/recipe 78 | name: com.oracle.weblogic.rewrite.spring.framework.ReplaceWebLogicLoadTimeWeaver 79 | displayName: Replace Removed WebLogicLoadTimeWeaver from Spring Framework 5.3.x to 6.2.x 80 | description: Replace removed WebLogicLoadTimeWeaver with LoadTimeWeaver from Spring Framework 6.2.x. 81 | tags: 82 | - springframework 83 | - weblogic 84 | - LoadTimeWeaver 85 | recipeList: 86 | - org.openrewrite.java.ChangeType: 87 | oldFullyQualifiedTypeName: org.springframework.instrument.classloading.weblogic.WebLogicLoadTimeWeaver 88 | newFullyQualifiedTypeName: org.springframework.instrument.classloading.LoadTimeWeaver 89 | --- 90 | type: specs.openrewrite.org/v1beta/recipe 91 | name: com.oracle.weblogic.rewrite.spring.data.UpgradeSpringDataBom 92 | displayName: Upgrade Spring Data BOM to 2024.1.x 93 | description: Upgrade Spring Data BOM to 2024.1.x version. 94 | tags: 95 | - springdata 96 | - springframework 97 | recipeList: 98 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion: 99 | groupId: org.springframework.data 100 | artifactId: spring-data-bom 101 | newVersion: 2024.1.x 102 | --- 103 | type: specs.openrewrite.org/v1beta/recipe 104 | name: com.oracle.weblogic.rewrite.spring.data.UpgradeSpringDataJpa 105 | displayName: Upgrade Spring Data JPA to 3.4.6 106 | description: Upgrade Spring Data JPA to 3.4.6 version, which is the version used by spring-data-bom v2024.1.x 107 | tags: 108 | - springdata 109 | - springframework 110 | recipeList: 111 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion: 112 | groupId: org.springframework.data 113 | artifactId: spring-data-jpa 114 | newVersion: 3.4.6 115 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/resources/META-INF/rewrite/examples-helpers.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. 3 | 4 | # Licensed under the Universal Permissive License v 1.0 as shown at 5 | # https://oss.oracle.com/licenses/upl. 6 | 7 | # Subject to the condition set forth below, permission is hereby granted to any 8 | # person obtaining a copy of this software, associated documentation and/or data 9 | # (collectively the "Software"), free of charge and under any and all copyright 10 | # rights in the Software, and any and all patent rights owned or freely 11 | # licensable by each licensor hereunder covering either (i) the unmodified 12 | # Software as contributed to or provided by such licensor, or (ii) the Larger 13 | # Works (as defined below), to deal in both 14 | 15 | # (a) the Software, and 16 | # (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | # one is included with the Software (each a "Larger Work" to which the Software 18 | # is contributed by such licensors), 19 | 20 | # without restriction, including without limitation the rights to copy, create 21 | # derivative works of, display, perform, and distribute the Software and make, 22 | # use, sell, offer for sale, import, export, have made, and have sold the 23 | # Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | # either these or other terms. 25 | 26 | # This license is subject to the following condition: 27 | # The above copyright notice and either this complete permission notice or at 28 | # a minimum a reference to the UPL must be included in all copies or 29 | # substantial portions of the Software. 30 | 31 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | # SOFTWARE. 38 | --- 39 | type: specs.openrewrite.org/v1beta/recipe 40 | name: com.oracle.weblogic.rewrite.examples.spring.MigratedPetClinicExtrasFor1511 41 | displayName: Add WebLogic 15.1.1 PetClinic extras 42 | description: Run migration extras for migrated Spring Framework PetClinic example run on WebLogic 15.1.1. 43 | tags: 44 | - springframework 45 | - examples 46 | - petclinic 47 | - weblogic 48 | recipeList: 49 | - com.oracle.weblogic.rewrite.examples.spring.ChangeCacheManagerToSimpleCacheManager 50 | - com.oracle.weblogic.rewrite.examples.AddImplicitTldFileWithTaglib3_0 51 | --- 52 | type: specs.openrewrite.org/v1beta/recipe 53 | name: com.oracle.weblogic.rewrite.examples.spring.SetupSpringFrameworkPetClinicFor1412 54 | displayName: Setup Spring Framework 5.3.x PetClinic for WebLogic 14.1.2 55 | description: Setup Spring Framework 5.3.x PetClinic for WebLogic 14.1.2. 56 | tags: 57 | - springframework 58 | - examples 59 | - petclinic 60 | - weblogic 61 | recipeList: 62 | - com.oracle.weblogic.rewrite.spring.framework.DefaultServletHandler 63 | - com.oracle.weblogic.rewrite.examples.AddImplicitTldFileWithTaglib2_1 64 | --- 65 | type: specs.openrewrite.org/v1beta/recipe 66 | name: com.oracle.weblogic.rewrite.examples.spring.ChangeCacheManagerToSimpleCacheManager 67 | displayName: Change cacheManager to use the SimpleCacheManager 68 | description: Change cacheManager to use the SimpleCacheManager. 69 | tags: 70 | - springframework 71 | - examples 72 | - cacheManager 73 | preconditions: 74 | - org.openrewrite.FindSourceFiles: 75 | filePattern: '**/tools-config.xml' 76 | recipeList: 77 | - org.openrewrite.xml.ChangeTagAttribute: 78 | attributeName: class 79 | elementName: //beans/bean[@id="cacheManager"] 80 | newValue: org.springframework.cache.support.SimpleCacheManager 81 | - org.openrewrite.xml.ChangeTagAttribute: 82 | attributeName: p:cacheManager-ref 83 | elementName: //beans/bean[@id="cacheManager"] 84 | newValue: null 85 | - org.openrewrite.xml.AddOrUpdateChildTag: 86 | parentXPath: //beans/bean[@id="cacheManager"] 87 | newChildTag: | 88 | 89 | 90 | 91 | 92 | 93 | 94 | - org.openrewrite.xml.RemoveXmlTag: 95 | xPath: //beans/bean[@id="ehcache"] 96 | --- 97 | type: specs.openrewrite.org/v1beta/recipe 98 | name: com.oracle.weblogic.rewrite.examples.AddImplicitTldFileWithTaglib3_0 99 | displayName: Add implicit TLD with taglib 3.0 100 | description: Add `implicit.tld` file with taglib 3.0 to `src/main/webapp/WEB-INF/tags`. 101 | tags: 102 | - weblogic 103 | - examples 104 | - taglib 105 | recipeList: 106 | - org.openrewrite.xml.CreateXmlFile: 107 | fileContents: > 108 | 109 | 110 | 1.0 111 | implicit 112 | 113 | relativeFileName: src/main/webapp/WEB-INF/tags/implicit.tld 114 | --- 115 | type: specs.openrewrite.org/v1beta/recipe 116 | name: com.oracle.weblogic.rewrite.examples.AddImplicitTldFileWithTaglib2_1 117 | displayName: Add implicit TLD with taglib 2.1 118 | description: Add `implicit.tld` file with taglib 2.1 to `src/main/webapp/WEB-INF/tags`. 119 | tags: 120 | - weblogic 121 | - examples 122 | - taglib 123 | recipeList: 124 | - org.openrewrite.xml.CreateXmlFile: 125 | fileContents: > 126 | 127 | 128 | 1.0 129 | implicit 130 | 131 | relativeFileName: src/main/webapp/WEB-INF/tags/implicit.tld -------------------------------------------------------------------------------- /rewrite-weblogic/docs/procedures/upgrade-151100-Spring.md: -------------------------------------------------------------------------------- 1 | # Upgrade to WebLogic Server 15.1.1, Spring Framework 6.2.x, and Hibernate 2 | 3 | The following procedure will apply the changes required for migrating applications to WebLogic Server 15.1.1.0.0, Jakarta EE 9.1, Spring Framework 6.2.x, and Hibernate. 4 | 5 | ## Prerequisites 6 | 7 | The following is required to build and run this project: 8 | 9 | - JDK - For migration, version 17 or later; post-migration, you need the target JDK installed. 10 | - Maven (minimum version 3.6, with recommended version, 3.9.9) or Gradle (version 4.0+) 11 | - Your code 12 | 13 | ## Get your code 14 | 15 | Clone your project to your local machine. 16 | 17 | > [!IMPORTANT] 18 | > Note that the `run` command will make changes to your code. Always make sure you have a backup of your code. When using git, create a branch and use `git diff` to see the differences. 19 | 20 | # Examples 21 | 22 | The following example sections illustrate the methods for upgrading your applications to WebLogic 15.1.1, Jakarta EE 9.1, Spring Framework 6.2.x, and Hibernate. 23 | 24 | You can run OpenRewrite recipes on your code folder using the Maven or Gradle CLI, or include them as a build plug-in in your `pom.xml` or `build.gradle` file. 25 | 26 | ## Run using the Maven CLI 27 | 28 | > [!NOTE] 29 | > You will need to have [Maven](https://maven.apache.org/download.cgi) installed on your machine before you can run the following command. 30 | 31 | For OpenRewrite to run, Maven dependencies must be resolved. If needed, run `mvn clean install` for missing dependencies. 32 | 33 | 1. Open a terminal at the root of the project and run: 34 | 35 | ```shell 36 | mvn clean install 37 | ``` 38 | 39 | Or, you can use other commands, such as `mvn dependency:resolve`. 40 | 41 | 2. Run the following Maven command to run OpenRewrite: 42 | 43 | ```shell 44 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 45 | -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE,com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST,org.openrewrite.recipe:rewrite-spring:RELEASE,org.openrewrite.recipe:rewrite-hibernate:RELEASE \ 46 | -Drewrite.activeRecipes=org.openrewrite.java.migrate.UpgradeToJava21,com.oracle.weblogic.rewrite.JakartaEE9_1,com.oracle.weblogic.rewrite.UpgradeTo1511,com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2,com.oracle.weblogic.rewrite.hibernate.MigrateHibernateToJakartaEE9 \ 47 | -Drewrite.exportDatatables=true 48 | ``` 49 | 50 | > [!NOTE] 51 | > When upgrading to WebLogic Server 15.1.1, the `UpgradeTo1511` recipe must be run _after_ the Java and Jakarta recipes.
52 | > Note that this command updates the application to use Java 21. If you want to upgrade to Java 17 instead, replace UpgradeToJava21 with UpgradeToJava17. 53 | 54 | ## Run using Maven with the `` in the `pom.xml` file 55 | 56 | 1. Add the plug-in to your `pom.xml` file and activate the recipes. The following example illustrates the recipes. 57 | 58 | ``` 59 | 60 | org.openrewrite.maven 61 | rewrite-maven-plugin 62 | 6.31 63 | 64 | true 65 | 66 | org.openrewrite.java.migrate.UpgradeToJava21 67 | com.oracle.weblogic.rewrite.JakartaEE9_1 68 | com.oracle.weblogic.rewrite.UpgradeTo1511 69 | com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2 70 | com.oracle.weblogic.rewrite.hibernate.MigrateHibernateToJakartaEE9 71 | 72 | 73 | 74 | 75 | org.openrewrite.recipe 76 | rewrite-migrate-java 77 | 3.4.0 78 | 79 | 80 | com.oracle.weblogic.rewrite 81 | rewrite-weblogic 82 | [0.6.0,) 83 | 84 | 85 | org.openrewrite.recipe 86 | rewrite-spring 87 | 6.3.0 88 | 89 | 90 | org.openrewrite.recipe 91 | rewrite-hibernate 92 | 2.4.0 93 | 94 | 95 | 96 | ``` 97 | 98 | 2. To run the recipe: `mvn rewrite:run` 99 | 100 | > [!TIP] 101 | > If you just want to dry run the recipe without changing the code, use `mvn rewrite:DryRun`. For more details when using Maven, see [here](https://docs.openrewrite.org/reference/rewrite-maven-plugin). 102 | 103 | ### Run using Gradle 104 | 105 | 1. Add the following to your `build.gradle` file: 106 | 107 | ``` 108 | plugins { 109 | id("org.openrewrite.rewrite") version("7.2.0") 110 | } 111 | 112 | rewrite { 113 | activeRecipe("org.openrewrite.java.migrate.UpgradeToJava21") 114 | activeRecipe("com.oracle.weblogic.rewrite.JakartaEE9_1") 115 | activeRecipe("com.oracle.weblogic.rewrite.UpgradeTo1511") 116 | activeRecipe("com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2") 117 | activeRecipe("com.oracle.weblogic.rewrite.hibernate.MigrateHibernateToJakartaEE9") 118 | setExportDatatables(true) 119 | } 120 | 121 | repositories { 122 | mavenCentral() 123 | } 124 | 125 | dependencies { 126 | rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.4.0") 127 | rewrite("com.oracle.weblogic.rewrite:rewrite-weblogic:+") 128 | rewrite("org.openrewrite.recipe:rewrite-spring:6.3.0") 129 | rewrite("org.openrewrite.recipe:rewrite-hibernate:2.4.0") 130 | } 131 | ``` 132 | 2. Run `gradle rewriteRun` to run the recipe. 133 | 134 | > [!TIP] 135 | > If you just want to dry run the recipe without changing the code, use `gradle rewriteDryRun`. For more details about the "dryRun" task, see [here](https://docs.openrewrite.org/reference/gradle-plugin-configuration#the-dryrun-task). 136 | 137 | > [!NOTE] 138 | > You can run Rewrite on a Gradle project without modifying the build, similar to using the `mvn` CLI command. For more information, see https://docs.openrewrite.org/running-recipes/running-rewrite-on-a-gradle-project-without-modifying-the-build. 139 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/java/com/oracle/weblogic/rewrite/jakarta/ChangeJakartaFacesMethodCalls.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 Oracle and/or its affiliates. 3 | * 4 | * Licensed under the Universal Permissive License v 1.0 as shown at 5 | * https://oss.oracle.com/licenses/upl. 6 | * 7 | */ 8 | package com.oracle.weblogic.rewrite.jakarta; 9 | 10 | import lombok.EqualsAndHashCode; 11 | import lombok.Value; 12 | import org.jetbrains.annotations.NotNull; 13 | import org.openrewrite.ExecutionContext; 14 | import org.openrewrite.NlsRewrite; 15 | import org.openrewrite.Recipe; 16 | import org.openrewrite.TreeVisitor; 17 | import org.openrewrite.java.JavaIsoVisitor; 18 | import org.openrewrite.java.JavaTemplate; 19 | import org.openrewrite.java.MethodMatcher; 20 | import org.openrewrite.java.tree.Expression; 21 | import org.openrewrite.java.tree.J; 22 | 23 | import java.util.regex.Pattern; 24 | 25 | /** 26 | * ChangeJakartaFacesMethodCalls updates the following deprecated method calls 27 | * 1. Application.createValueBinding("#{somestringexpression}") => 28 | * Application.createValueExpression(FacesContext.getCurrentInstance().getELContext(), "#{somestringexpression}", Object.class) 29 | * 2. ValueExpression.getValue(someFacesContext) => ValueExpression.getValue(someFacesContext.getELContext()) 30 | */ 31 | @Value 32 | @EqualsAndHashCode(callSuper = false) 33 | public class ChangeJakartaFacesMethodCalls extends Recipe { 34 | 35 | private static final String GET_EXPRESSION_FACTORY_METHOD_NAME = "getExpressionFactory"; 36 | private static final String CREATE_VALUE_EXPRESSION_METHOD_NAME = "createValueExpression"; 37 | private static final String GET_EL_CONTEXT_METHOD_CALL = "FacesContext.getCurrentInstance().getELContext()"; 38 | 39 | private static final MethodMatcher createValueBindingMatcher = new MethodMatcher( 40 | "*.faces.application.Application createValueBinding(java.lang.String)"); 41 | private static final MethodMatcher getValueMatcher = new MethodMatcher( 42 | "jakarta.el.ValueExpression getValue(jakarta.faces.context.FacesContext)"); 43 | private static final Pattern VALUE_EXPRESSION_PATTERN 44 | = Pattern.compile("jakarta.el.ValueExpression"); 45 | private static final Pattern FACES_CONTEXT_PATTERN = Pattern.compile("jakarta.faces.context.FacesContext"); 46 | 47 | @Override 48 | public @NlsRewrite.DisplayName @NotNull String getDisplayName() { 49 | return "ChangeJakartaFacesMethodCalls"; 50 | } 51 | 52 | @Override 53 | public @NlsRewrite.Description @NotNull String getDescription() { 54 | return "Handle method call changes for deprecated Faces/EL methods with different arguments from the original."; 55 | } 56 | 57 | @Override 58 | public TreeVisitor getVisitor() { 59 | return new JavaIsoVisitor() { 60 | @Override 61 | public J.MethodInvocation visitMethodInvocation(J.MethodInvocation methodCall, ExecutionContext ctx) { 62 | J.MethodInvocation m = methodCall; 63 | // Find out whether method invocation matches 64 | if (createValueBindingMatcher.matches(methodCall)) { 65 | m = replaceCreateValueBinding(methodCall); 66 | } else if (isGetValueMethod(methodCall)) { 67 | m = changeGetValueArgument(methodCall); 68 | } 69 | return super.visitMethodInvocation(m, ctx); 70 | } 71 | 72 | private J.MethodInvocation changeGetValueArgument(J.MethodInvocation methodCall) { 73 | J.Identifier objectIdentifier = (J.Identifier) methodCall.getSelect(); 74 | if (objectIdentifier == null) { 75 | return methodCall; 76 | } 77 | Expression firstArg = methodCall.getArguments().get(0); 78 | if (firstArg.getType() != null && firstArg.getType().isAssignableFrom(FACES_CONTEXT_PATTERN)) { 79 | final String newArg = methodCall.getArguments().get(0) + ".getELContext()"; 80 | final String newGetValueTemplateStr = String.format("%s.%s(%s)", 81 | objectIdentifier.getSimpleName(), 82 | methodCall.getSimpleName(), 83 | newArg); 84 | JavaTemplate newGetValueTemplate = JavaTemplate 85 | .builder(newGetValueTemplateStr).build(); 86 | return newGetValueTemplate.apply(getCursor(), methodCall.getCoordinates().replace()); 87 | } 88 | return methodCall; 89 | } 90 | 91 | private J.MethodInvocation replaceCreateValueBinding(J.MethodInvocation methodCall) { 92 | J.Identifier objectIdentifier = (J.Identifier) methodCall.getSelect(); 93 | if (objectIdentifier == null) { 94 | return methodCall; 95 | } 96 | final String newMethodCallTemplate = String.format( 97 | "%s.%s().%s(%s, #{any(java.lang.String)}, Object.class)", 98 | objectIdentifier.getSimpleName(), 99 | GET_EXPRESSION_FACTORY_METHOD_NAME, 100 | CREATE_VALUE_EXPRESSION_METHOD_NAME, 101 | // 1st argument is an EL context 102 | GET_EL_CONTEXT_METHOD_CALL 103 | // 2nd argument will be filled in with the String argument from the original method call 104 | // 3rd argument is already inlined in the format string above. 105 | ); 106 | JavaTemplate createValueExpressionTemplate = JavaTemplate 107 | .builder(newMethodCallTemplate) 108 | .imports("jakarta.faces.context.FacesContext") 109 | .build(); 110 | 111 | // apply the template and substitute with the argument from the original method call 112 | return createValueExpressionTemplate.apply( 113 | getCursor(), methodCall.getCoordinates().replace(), methodCall.getArguments().get(0)); 114 | } 115 | }; 116 | } 117 | 118 | private boolean isGetValueMethod(J.MethodInvocation methodCall) { 119 | if (methodCall.getMethodType() != null) { 120 | return getValueMatcher.matches(methodCall); 121 | } 122 | Expression objForMethodCall = methodCall.getSelect(); 123 | // in unit tests, the method type comes through as null, so the matcher does not work. 124 | return (objForMethodCall != null && objForMethodCall.getType() != null && 125 | objForMethodCall.getType().isAssignableFrom(VALUE_EXPRESSION_PATTERN) && 126 | methodCall.getArguments().size() == 1 && 127 | methodCall.getArguments().get(0).getType() != null && 128 | methodCall.getArguments().get(0).getType().isAssignableFrom(FACES_CONTEXT_PATTERN) 129 | ); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /rewrite-weblogic/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.oracle.weblogic.rewrite 7 | rewrite-weblogic 8 | 0.6.2 9 | 10 | rewrite-weblogic 11 | Migrate your WebLogic applications to the latest version of WebLogic 12 | and Java with OpenRewrite. Automatically. 13 | https://github.com/oracle/rewrite-recipes/tree/main/rewrite-weblogic 14 | 2025 15 | 16 | 17 | 18 | The Universal Permissive License (UPL), Version 1.0 19 | http://www.oracle.com/technetwork/licenses/upl-license-2927578.html 20 | repo 21 | 22 | 23 | 24 | 25 | oracle 26 | Oracle 27 | https://www.oracle.com 28 | 29 | 30 | 31 | scm:git:git@github.com:oracle/rewrite-recipes.git 32 | scm:git:ssh://github.com:oracle/rewrite-recipes.git 33 | https://github.com/oracle/rewrite-recipes/tree/main/rewrite-weblogic 34 | 35 | 36 | 37 | UTF-8 38 | UTF-8 39 | 17 40 | 41 | 42 | 43 | 44 | 45 | org.openrewrite.recipe 46 | rewrite-recipe-bom 47 | 3.12.1 48 | pom 49 | import 50 | 51 | 52 | org.junit 53 | junit-bom 54 | 5.12.1 55 | pom 56 | import 57 | 58 | 59 | 60 | 61 | 62 | 63 | org.openrewrite 64 | rewrite-maven 65 | compile 66 | 67 | 68 | org.openrewrite 69 | rewrite-java 70 | compile 71 | 72 | 73 | org.openrewrite 74 | rewrite-java-8 75 | runtime 76 | 77 | 78 | org.openrewrite 79 | rewrite-java-11 80 | runtime 81 | 82 | 83 | org.openrewrite 84 | rewrite-java-17 85 | runtime 86 | 87 | 88 | org.openrewrite 89 | rewrite-java-21 90 | runtime 91 | 92 | 93 | org.openrewrite 94 | rewrite-yaml 95 | 96 | 97 | 98 | org.openrewrite 99 | rewrite-properties 100 | 101 | 102 | 103 | org.projectlombok 104 | lombok 105 | 1.18.38 106 | true 107 | 108 | 109 | org.openrewrite 110 | rewrite-test 111 | test 112 | 113 | 114 | jakarta.platform 115 | jakarta.jakartaee-api 116 | 9.1.0 117 | test 118 | 119 | 120 | jakarta.platform 121 | jakarta.jakartaee-web-api 122 | 9.1.0 123 | test 124 | 125 | 126 | 127 | 128 | 129 | 130 | maven-surefire-plugin 131 | 3.5.3 132 | 133 | 134 | org.apache.maven.plugins 135 | maven-compiler-plugin 136 | 3.14.0 137 | 138 | 139 | 140 | org.projectlombok 141 | lombok 142 | 1.18.38 143 | 144 | 145 | 146 | -parameters 147 | 148 | 149 | 150 | 151 | org.apache.maven.plugins 152 | maven-jar-plugin 153 | 3.4.2 154 | 155 | 156 | 157 | ${project.name} 158 | ${project.version} 159 | 160 | 161 | 162 | 163 | 164 | org.openrewrite.maven 165 | rewrite-maven-plugin 166 | 6.15.0 167 | 168 | com.oracle.weblogic.rewrite.RecipeBestPractices 169 | true 170 | 171 | 172 | 173 | org.openrewrite.recipe 174 | rewrite-recommendations 175 | 1.15.0 176 | 177 | 178 | 179 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/java/com/oracle/weblogic/rewrite/jakarta/UpgradeMavenPluginArtifactItems.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 Oracle and/or its affiliates. 3 | * 4 | * Licensed under the Universal Permissive License v 1.0 as shown at 5 | * https://oss.oracle.com/licenses/upl. 6 | * 7 | */ 8 | package com.oracle.weblogic.rewrite.jakarta; 9 | 10 | import static org.openrewrite.internal.StringUtils.matchesGlob; 11 | 12 | import java.util.ArrayList; 13 | import java.util.Collection; 14 | import java.util.Collections; 15 | import java.util.Optional; 16 | 17 | import org.jspecify.annotations.Nullable; 18 | 19 | import org.openrewrite.ExecutionContext; 20 | import org.openrewrite.maven.MavenDownloadingException; 21 | import org.openrewrite.maven.MavenIsoVisitor; 22 | import org.openrewrite.Option; 23 | import org.openrewrite.Recipe; 24 | import org.openrewrite.TreeVisitor; 25 | 26 | import org.openrewrite.maven.table.MavenMetadataFailures; 27 | import org.openrewrite.maven.tree.MavenMetadata; 28 | import org.openrewrite.semver.Semver; 29 | import org.openrewrite.semver.VersionComparator; 30 | import org.openrewrite.xml.XPathMatcher; 31 | import org.openrewrite.xml.tree.Xml; 32 | 33 | import lombok.EqualsAndHashCode; 34 | import lombok.Value; 35 | 36 | /** 37 | * UpgradeMavenPluginArtifactItems is an imperative recipe to upgrade the groupId, artifactId and version of an artifactIem, 38 | * of a Maven plugin. 39 | */ 40 | 41 | @Value 42 | @EqualsAndHashCode(callSuper = false) 43 | public class UpgradeMavenPluginArtifactItems extends Recipe { 44 | 45 | @EqualsAndHashCode.Exclude 46 | transient MavenMetadataFailures metadataFailures = new MavenMetadataFailures(this); 47 | 48 | @Option(displayName = "Old group ID", 49 | description = "The old group ID to replace.", 50 | example = "javax") 51 | String oldGroupId; 52 | 53 | @Option(displayName = "Old artifact ID", 54 | description = "The old artifact ID to replace.", 55 | example = "javax") 56 | String oldArtifactId; 57 | 58 | @Option(displayName = "New group ID", 59 | description = "The new group ID to use.", 60 | example = "jakarta.platform") 61 | String newGroupId; 62 | 63 | @Option(displayName = "New artifact ID", 64 | description = "The new artifact ID to use.", 65 | example = "javaee-api") 66 | String newArtifactId; 67 | 68 | @Option(displayName = "New version", 69 | description = "An exact version number.", 70 | example = "9.1", 71 | required = false) 72 | @Nullable 73 | String newVersion; 74 | 75 | private static final XPathMatcher PLUGIN_ARTIFACT_ITEM_MATCHER = new XPathMatcher("/project/build/plugins/plugin/executions/execution/configuration/artifactItems/artifactItem"); 76 | 77 | private static final String GROUP_ID = "groupId"; 78 | private static final String ARTIFACT_ID = "artifactId"; 79 | private static final String ARTIFACT_VERSION = "version"; 80 | 81 | @Override 82 | public String getDescription() { 83 | return "Change the groupId and the artifactId of an artifactItem in the configuration section of a plugin's execution. " + 84 | "This recipe does not perform any validation and assumes all values passed are valid."; 85 | } 86 | 87 | @Override 88 | public String getDisplayName() { 89 | return "Upgrade group, artifact ID and version of an artifactItem, of a maven plugin execution configuration"; 90 | } 91 | 92 | @Override 93 | public TreeVisitor getVisitor() { 94 | return new MavenIsoVisitor() { 95 | @Nullable 96 | final VersionComparator versionComparator = newVersion != null ? Semver.validate(newVersion, null).getValue() : null; 97 | @Nullable 98 | private Collection availableVersions; 99 | 100 | @Override 101 | public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) { 102 | Xml.Tag t = super.visitTag(tag, ctx); 103 | if (PLUGIN_ARTIFACT_ITEM_MATCHER.matches(getCursor())) { 104 | // Find out whether oldGroupId really exists, consider the value defined as a project property as well 105 | boolean isGroupIdFound = tag.getChildValue(GROUP_ID) 106 | .map(a -> matchesGlob(a, oldGroupId)) 107 | .orElse(oldGroupId == null); 108 | isGroupIdFound = isElementFound(tag, isGroupIdFound, GROUP_ID, oldGroupId); 109 | 110 | // Find out whether oldArtifactId really exists, consider the value defined as a project property as well 111 | boolean isArtifactIdFound = tag.getChildValue(ARTIFACT_ID) 112 | .map(a -> matchesGlob(a, oldArtifactId)) 113 | .orElse(oldArtifactId == null); 114 | isArtifactIdFound = isElementFound(tag, isArtifactIdFound, ARTIFACT_ID, oldArtifactId); 115 | 116 | // Change the child tag value only when oldGroupId and oldArtifactId is found 117 | if (isGroupIdFound && isArtifactIdFound) { 118 | if (newGroupId != null) { 119 | t = changeChildTagValue(t, GROUP_ID, newGroupId, ctx); 120 | } 121 | 122 | if (newArtifactId != null) { 123 | t = changeChildTagValue(t, ARTIFACT_ID, newArtifactId, ctx); 124 | } 125 | 126 | String currentVersion = t.getChildValue(ARTIFACT_VERSION).orElse(null); 127 | if (newVersion != null) { 128 | try { 129 | String resolvedNewVersion = resolveSemverVersion(ctx, newGroupId, newArtifactId, currentVersion); 130 | Optional versionTag = t.getChild(ARTIFACT_VERSION); 131 | boolean versionTagPresent = versionTag.isPresent(); 132 | if (versionTagPresent) { 133 | t = changeChildTagValue(t, ARTIFACT_VERSION, resolvedNewVersion, ctx); 134 | } 135 | } catch (MavenDownloadingException e) { 136 | return e.warn(tag); 137 | } 138 | } 139 | } 140 | } 141 | return t; 142 | } 143 | 144 | private boolean isElementFound(Xml.Tag tag, boolean isElementFound, String groupId, String oldGroupId) { 145 | if (!isElementFound) { 146 | if (tag.getChildValue(groupId).isPresent() && tag.getChildValue(groupId).get().trim().startsWith("${")) { 147 | String propertyKey = tag.getChildValue(groupId).get().trim(); 148 | String value = getResolutionResult().getPom().getValue(propertyKey); 149 | isElementFound = value != null && matchesGlob(value, oldGroupId); 150 | } 151 | } 152 | return isElementFound; 153 | } 154 | 155 | @SuppressWarnings("ConstantConditions") 156 | private String resolveSemverVersion(ExecutionContext ctx, String groupId, String artifactId, @Nullable String currentVersion) throws MavenDownloadingException { 157 | if (versionComparator == null) { 158 | return newVersion; 159 | } 160 | String finalCurrentVersion = currentVersion != null ? currentVersion : newVersion; 161 | if (availableVersions == null) { 162 | availableVersions = new ArrayList<>(); 163 | MavenMetadata mavenMetadata = metadataFailures.insertRows(ctx, () -> downloadMetadata(groupId, artifactId, ctx)); 164 | for (String v : mavenMetadata.getVersioning().getVersions()) { 165 | if (versionComparator.isValid(finalCurrentVersion, v)) { 166 | availableVersions.add(v); 167 | } 168 | } 169 | } 170 | return availableVersions.isEmpty() ? newVersion : Collections.max(availableVersions, versionComparator); 171 | } 172 | }; 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /THIRD_PARTY_LICENSES.txt: -------------------------------------------------------------------------------- 1 | Third Party Attributions - Third Party Runtime Dependencies 2 | 3 | The following software (or subsets of the software) are dependencies that are used at runtime by an application built using this code. 4 | 5 | -------------------------------------------------------------------------------- 6 | 7 | openrewrite/ rewrite-recipe-bom, rewrite-migrate-java, rewrite-maven-plugin, rewrite-maven, rewrite-test, rewrite-spring 8 | Copyright 2020-2024 The Apache Software Foundation 9 | 10 | This product includes software developed at 11 | The Apache Software Foundation (http://www.apache.org/). 12 | License: Apache License 2.0, a copy of the license is included at the end of this file. 13 | 14 | -------------------------------------------------------------------------------- 15 | 16 | ================================================================================ 17 | Apache License 18 | Version 2.0, January 2004 19 | http://www.apache.org/licenses/ 20 | 21 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 22 | 23 | 1. Definitions. 24 | 25 | "License" shall mean the terms and conditions for use, reproduction, 26 | and distribution as defined by Sections 1 through 9 of this document. 27 | 28 | "Licensor" shall mean the copyright owner or entity authorized by 29 | the copyright owner that is granting the License. 30 | 31 | "Legal Entity" shall mean the union of the acting entity and all 32 | other entities that control, are controlled by, or are under common 33 | control with that entity. For the purposes of this definition, 34 | "control" means (i) the power, direct or indirect, to cause the 35 | direction or management of such entity, whether by contract or 36 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 37 | outstanding shares, or (iii) beneficial ownership of such entity. 38 | 39 | "You" (or "Your") shall mean an individual or Legal Entity 40 | exercising permissions granted by this License. 41 | 42 | "Source" form shall mean the preferred form for making modifications, 43 | including but not limited to software source code, documentation 44 | source, and configuration files. 45 | 46 | "Object" form shall mean any form resulting from mechanical 47 | transformation or translation of a Source form, including but 48 | not limited to compiled object code, generated documentation, 49 | and conversions to other media types. 50 | 51 | "Work" shall mean the work of authorship, whether in Source or 52 | Object form, made available under the License, as indicated by a 53 | copyright notice that is included in or attached to the work 54 | (an example is provided in the Appendix below). 55 | 56 | "Derivative Works" shall mean any work, whether in Source or Object 57 | form, that is based on (or derived from) the Work and for which the 58 | editorial revisions, annotations, elaborations, or other modifications 59 | represent, as a whole, an original work of authorship. For the purposes 60 | of this License, Derivative Works shall not include works that remain 61 | separable from, or merely link (or bind by name) to the interfaces of, 62 | the Work and Derivative Works thereof. 63 | 64 | "Contribution" shall mean any work of authorship, including 65 | the original version of the Work and any modifications or additions 66 | to that Work or Derivative Works thereof, that is intentionally 67 | submitted to Licensor for inclusion in the Work by the copyright owner 68 | or by an individual or Legal Entity authorized to submit on behalf of 69 | the copyright owner. For the purposes of this definition, "submitted" 70 | means any form of electronic, verbal, or written communication sent 71 | to the Licensor or its representatives, including but not limited to 72 | communication on electronic mailing lists, source code control systems, 73 | and issue tracking systems that are managed by, or on behalf of, the 74 | Licensor for the purpose of discussing and improving the Work, but 75 | excluding communication that is conspicuously marked or otherwise 76 | designated in writing by the copyright owner as "Not a Contribution." 77 | 78 | "Contributor" shall mean Licensor and any individual or Legal Entity 79 | on behalf of whom a Contribution has been received by Licensor and 80 | subsequently incorporated within the Work. 81 | 82 | 2. Grant of Copyright License. Subject to the terms and conditions of 83 | this License, each Contributor hereby grants to You a perpetual, 84 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 85 | copyright license to reproduce, prepare Derivative Works of, 86 | publicly display, publicly perform, sublicense, and distribute the 87 | Work and such Derivative Works in Source or Object form. 88 | 89 | 3. Grant of Patent License. Subject to the terms and conditions of 90 | this License, each Contributor hereby grants to You a perpetual, 91 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 92 | (except as stated in this section) patent license to make, have made, 93 | use, offer to sell, sell, import, and otherwise transfer the Work, 94 | where such license applies only to those patent claims licensable 95 | by such Contributor that are necessarily infringed by their 96 | Contribution(s) alone or by combination of their Contribution(s) 97 | with the Work to which such Contribution(s) was submitted. If You 98 | institute patent litigation against any entity (including a 99 | cross-claim or counterclaim in a lawsuit) alleging that the Work 100 | or a Contribution incorporated within the Work constitutes direct 101 | or contributory patent infringement, then any patent licenses 102 | granted to You under this License for that Work shall terminate 103 | as of the date such litigation is filed. 104 | 105 | 4. Redistribution. You may reproduce and distribute copies of the 106 | Work or Derivative Works thereof in any medium, with or without 107 | modifications, and in Source or Object form, provided that You 108 | meet the following conditions: 109 | 110 | (a) You must give any other recipients of the Work or 111 | Derivative Works a copy of this License; and 112 | 113 | (b) You must cause any modified files to carry prominent notices 114 | stating that You changed the files; and 115 | 116 | (c) You must retain, in the Source form of any Derivative Works 117 | that You distribute, all copyright, patent, trademark, and 118 | attribution notices from the Source form of the Work, 119 | excluding those notices that do not pertain to any part of 120 | the Derivative Works; and 121 | 122 | (d) If the Work includes a "NOTICE" text file as part of its 123 | distribution, then any Derivative Works that You distribute must 124 | include a readable copy of the attribution notices contained 125 | within such NOTICE file, excluding those notices that do not 126 | pertain to any part of the Derivative Works, in at least one 127 | of the following places: within a NOTICE text file distributed 128 | as part of the Derivative Works; within the Source form or 129 | documentation, if provided along with the Derivative Works; or, 130 | within a display generated by the Derivative Works, if and 131 | wherever such third-party notices normally appear. The contents 132 | of the NOTICE file are for informational purposes only and 133 | do not modify the License. You may add Your own attribution 134 | notices within Derivative Works that You distribute, alongside 135 | or as an addendum to the NOTICE text from the Work, provided 136 | that such additional attribution notices cannot be construed 137 | as modifying the License. 138 | 139 | You may add Your own copyright statement to Your modifications and 140 | may provide additional or different license terms and conditions 141 | for use, reproduction, or distribution of Your modifications, or 142 | for any such Derivative Works as a whole, provided Your use, 143 | reproduction, and distribution of the Work otherwise complies with 144 | the conditions stated in this License. 145 | 146 | 5. Submission of Contributions. Unless You explicitly state otherwise, 147 | any Contribution intentionally submitted for inclusion in the Work 148 | by You to the Licensor shall be under the terms and conditions of 149 | this License, without any additional terms or conditions. 150 | Notwithstanding the above, nothing herein shall supersede or modify 151 | the terms of any separate license agreement you may have executed 152 | with Licensor regarding such Contributions. 153 | 154 | 6. Trademarks. This License does not grant permission to use the trade 155 | names, trademarks, service marks, or product names of the Licensor, 156 | except as required for reasonable and customary use in describing the 157 | origin of the Work and reproducing the content of the NOTICE file. 158 | 159 | 7. Disclaimer of Warranty. Unless required by applicable law or 160 | agreed to in writing, Licensor provides the Work (and each 161 | Contributor provides its Contributions) on an "AS IS" BASIS, 162 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 163 | implied, including, without limitation, any warranties or conditions 164 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 165 | PARTICULAR PURPOSE. You are solely responsible for determining the 166 | appropriateness of using or redistributing the Work and assume any 167 | risks associated with Your exercise of permissions under this License. 168 | 169 | 8. Limitation of Liability. In no event and under no legal theory, 170 | whether in tort (including negligence), contract, or otherwise, 171 | unless required by applicable law (such as deliberate and grossly 172 | negligent acts) or agreed to in writing, shall any Contributor be 173 | liable to You for damages, including any direct, indirect, special, 174 | incidental, or consequential damages of any character arising as a 175 | result of this License or out of the use or inability to use the 176 | Work (including but not limited to damages for loss of goodwill, 177 | work stoppage, computer failure or malfunction, or any and all 178 | other commercial damages or losses), even if such Contributor 179 | has been advised of the possibility of such damages. 180 | 181 | 9. Accepting Warranty or Additional Liability. While redistributing 182 | the Work or Derivative Works thereof, You may choose to offer, 183 | and charge a fee for, acceptance of support, warranty, indemnity, 184 | or other liability obligations and/or rights consistent with this 185 | License. However, in accepting such obligations, You may act only 186 | on Your own behalf and on Your sole responsibility, not on behalf 187 | of any other Contributor, and only if You agree to indemnify, 188 | defend, and hold each Contributor harmless for any liability 189 | incurred by, or claims asserted against, such Contributor by reason 190 | of your accepting any such warranty or additional liability. 191 | 192 | END OF TERMS AND CONDITIONS 193 | 194 | APPENDIX: How to apply the Apache License to your work. 195 | 196 | To apply the Apache License to your work, attach the following 197 | boilerplate notice, with the fields enclosed by brackets "[]" 198 | replaced with your own identifying information. (Don't include 199 | the brackets!) The text should be enclosed in the appropriate 200 | comment syntax for the file format. We also recommend that a 201 | file or class name and description of purpose be included on the 202 | same "printed page" as the copyright notice for easier 203 | identification within third-party archives. 204 | 205 | Copyright 2017 Oracle Corporation 206 | 207 | Licensed under the Apache License, Version 2.0 (the "License"); 208 | you may not use this file except in compliance with the License. 209 | You may obtain a copy of the License at 210 | 211 | http://www.apache.org/licenses/LICENSE-2.0 212 | 213 | Unless required by applicable law or agreed to in writing, software 214 | distributed under the License is distributed on an "AS IS" BASIS, 215 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 216 | See the License for the specific language governing permissions and 217 | limitations under the License. 218 | 219 | 220 | 221 | ================================================================================ 222 | The Universal Permissive License (UPL), Version 1.0 223 | 224 | Subject to the condition set forth below, permission is hereby granted to any 225 | person obtaining a copy of this software, associated documentation and/or data 226 | (collectively the "Software"), free of charge and under any and all copyright 227 | rights in the Software, and any and all patent rights owned or freely 228 | licensable by each licensor hereunder covering either (i) the unmodified 229 | Software as contributed to or provided by such licensor, or (ii) the Larger 230 | Works (as defined below), to deal in both 231 | 232 | (a) the Software, and 233 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 234 | one is included with the Software (each a "Larger Work" to which the Software 235 | is contributed by such licensors), 236 | 237 | without restriction, including without limitation the rights to copy, create 238 | derivative works of, display, perform, and distribute the Software and make, 239 | use, sell, offer for sale, import, export, have made, and have sold the 240 | Software and the Larger Work(s), and to sublicense the foregoing rights on 241 | either these or other terms. 242 | 243 | This license is subject to the following condition: 244 | The above copyright notice and either this complete permission notice or at 245 | a minimum a reference to the UPL must be included in all copies or 246 | substantial portions of the Software. 247 | 248 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 249 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 250 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 251 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 252 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 253 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 254 | SOFTWARE. 255 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/resources/META-INF/rewrite/weblogic-deprecations.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. 3 | 4 | # Licensed under the Universal Permissive License v 1.0 as shown at 5 | # https://oss.oracle.com/licenses/upl. 6 | 7 | # Subject to the condition set forth below, permission is hereby granted to any 8 | # person obtaining a copy of this software, associated documentation and/or data 9 | # (collectively the "Software"), free of charge and under any and all copyright 10 | # rights in the Software, and any and all patent rights owned or freely 11 | # licensable by each licensor hereunder covering either (i) the unmodified 12 | # Software as contributed to or provided by such licensor, or (ii) the Larger 13 | # Works (as defined below), to deal in both 14 | 15 | # (a) the Software, and 16 | # (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | # one is included with the Software (each a "Larger Work" to which the Software 18 | # is contributed by such licensors), 19 | 20 | # without restriction, including without limitation the rights to copy, create 21 | # derivative works of, display, perform, and distribute the Software and make, 22 | # use, sell, offer for sale, import, export, have made, and have sold the 23 | # Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | # either these or other terms. 25 | 26 | # This license is subject to the following condition: 27 | # The above copyright notice and either this complete permission notice or at 28 | # a minimum a reference to the UPL must be included in all copies or 29 | # substantial portions of the Software. 30 | 31 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | # SOFTWARE. 38 | --- 39 | type: specs.openrewrite.org/v1beta/recipe 40 | name: com.oracle.weblogic.rewrite.CheckAndCommentOutDeprecations1511 41 | displayName: Check and Comment Out Deprecations removed on WebLogic version 15.1.1 42 | description: This recipe will check and comment out deprecations on WebLogic version 15.1.1. 43 | recipeList: 44 | - com.oracle.weblogic.rewrite.CheckAndCommentOutDeprecations1412 45 | --- 46 | type: specs.openrewrite.org/v1beta/recipe 47 | name: com.oracle.weblogic.rewrite.CheckAndCommentOutDeprecations1412 48 | displayName: Check and Comment Out Deprecations removed on WebLogic version 14.1.2 49 | description: This recipe will check and comment out deprecations on WebLogic version 14.1.2. 50 | recipeList: 51 | - org.openrewrite.yaml.CommentOutProperty: 52 | propertyKey: com.oracle.weblogic.lifecycle.Orchestrator 53 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 54 | 55 | - org.openrewrite.yaml.CommentOutProperty: 56 | propertyKey: com.oracle.weblogic.lifecycle.core.LifecycleUtils 57 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 58 | 59 | - org.openrewrite.yaml.CommentOutProperty: 60 | propertyKey: weblogic.jdbc.extensions.DataSourceSwitchingCallback 61 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 62 | 63 | - org.openrewrite.yaml.CommentOutProperty: 64 | propertyKey: weblogic.jdbc.rowset.BaseRowSet 65 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 66 | 67 | - org.openrewrite.yaml.CommentOutProperty: 68 | propertyKey: weblogic.jdbc.rowset.CachedRow 69 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 70 | 71 | - org.openrewrite.yaml.CommentOutProperty: 72 | propertyKey: weblogic.jdbc.rowset.CachedRowSetImpl 73 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 74 | 75 | - org.openrewrite.yaml.CommentOutProperty: 76 | propertyKey: weblogic.jdbc.rowset.FilteredRowSetImpl 77 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 78 | 79 | - org.openrewrite.yaml.CommentOutProperty: 80 | propertyKey: weblogic.jdbc.rowset.JdbcRowSetFactory 81 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 82 | 83 | - org.openrewrite.yaml.CommentOutProperty: 84 | propertyKey: weblogic.jdbc.rowset.JdbcRowSetImpl 85 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 86 | 87 | - org.openrewrite.yaml.CommentOutProperty: 88 | propertyKey: weblogic.jdbc.rowset.JoinRowSetImpl 89 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 90 | 91 | - org.openrewrite.yaml.CommentOutProperty: 92 | propertyKey: weblogic.jdbc.rowset.NullUpdateException 93 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 94 | 95 | - org.openrewrite.yaml.CommentOutProperty: 96 | propertyKey: weblogic.jdbc.rowset.OptimisticConflictException 97 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 98 | 99 | - org.openrewrite.yaml.CommentOutProperty: 100 | propertyKey: weblogic.jdbc.rowset.RowNotFoundException 101 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 102 | 103 | - org.openrewrite.yaml.CommentOutProperty: 104 | propertyKey: weblogic.jdbc.rowset.RowSetFactory 105 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 106 | 107 | - org.openrewrite.yaml.CommentOutProperty: 108 | propertyKey: weblogic.jdbc.rowset.SQLComparator 109 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 110 | 111 | - org.openrewrite.yaml.CommentOutProperty: 112 | propertyKey: weblogic.jdbc.rowset.SQLPredicate 113 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 114 | 115 | - org.openrewrite.yaml.CommentOutProperty: 116 | propertyKey: weblogic.jdbc.rowset.SortedRowSet 117 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 118 | 119 | - org.openrewrite.yaml.CommentOutProperty: 120 | propertyKey: weblogic.jdbc.rowset.WLCachedRowSet 121 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 122 | 123 | - org.openrewrite.yaml.CommentOutProperty: 124 | propertyKey: weblogic.jdbc.rowset.WLRowSetInternal 125 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 126 | 127 | - org.openrewrite.yaml.CommentOutProperty: 128 | propertyKey: weblogic.jdbc.rowset.WLRowSetMetaData 129 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 130 | 131 | - org.openrewrite.yaml.CommentOutProperty: 132 | propertyKey: weblogic.jdbc.rowset.WebRowSetImpl 133 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 134 | 135 | - org.openrewrite.yaml.CommentOutProperty: 136 | propertyKey: weblogic.management.configuration.ForeignJMSConnectionFactoryMBean 137 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 138 | 139 | - org.openrewrite.yaml.CommentOutProperty: 140 | propertyKey: weblogic.management.configuration.ForeignJMSDestinationMBean 141 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 142 | 143 | - org.openrewrite.yaml.CommentOutProperty: 144 | propertyKey: weblogic.management.configuration.ForeignJMSServerMBean 145 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 146 | 147 | - org.openrewrite.yaml.CommentOutProperty: 148 | propertyKey: weblogic.management.configuration.JDBCPropertyOverrideMBean 149 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 150 | 151 | - org.openrewrite.yaml.CommentOutProperty: 152 | propertyKey: weblogic.management.configuration.JDBCSystemResourceOverrideMBean 153 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 154 | 155 | - org.openrewrite.yaml.CommentOutProperty: 156 | propertyKey: weblogic.management.configuration.JMSConnectionFactoryMBean 157 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 158 | 159 | - org.openrewrite.yaml.CommentOutProperty: 160 | propertyKey: weblogic.management.configuration.JMSDestCommonMBean 161 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 162 | 163 | - org.openrewrite.yaml.CommentOutProperty: 164 | propertyKey: weblogic.management.configuration.JMSDestinationKeyMBean 165 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 166 | 167 | - org.openrewrite.yaml.CommentOutProperty: 168 | propertyKey: weblogic.management.configuration.JMSDestinationMBean 169 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 170 | 171 | - org.openrewrite.yaml.CommentOutProperty: 172 | propertyKey: weblogic.management.configuration.JMSDistributedDestinationMBean 173 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 174 | 175 | - org.openrewrite.yaml.CommentOutProperty: 176 | propertyKey: weblogic.management.configuration.JMSDistributedDestinationMemberMBean 177 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 178 | 179 | - org.openrewrite.yaml.CommentOutProperty: 180 | propertyKey: weblogic.management.configuration.JMSDistributedQueueMBean 181 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 182 | 183 | - org.openrewrite.yaml.CommentOutProperty: 184 | propertyKey: weblogic.management.configuration.JMSDistributedQueueMemberMBean 185 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 186 | 187 | - org.openrewrite.yaml.CommentOutProperty: 188 | propertyKey: weblogic.management.configuration.JMSDistributedTopicMBean 189 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 190 | 191 | - org.openrewrite.yaml.CommentOutProperty: 192 | propertyKey: weblogic.management.configuration.JMSDistributedTopicMemberMBean 193 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 194 | 195 | - org.openrewrite.yaml.CommentOutProperty: 196 | propertyKey: weblogic.management.configuration.JMSFileStoreMBean 197 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 198 | 199 | - org.openrewrite.yaml.CommentOutProperty: 200 | propertyKey: weblogic.management.configuration.JMSInteropModuleMBean 201 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 202 | 203 | - org.openrewrite.yaml.CommentOutProperty: 204 | propertyKey: weblogic.management.configuration.JMSJDBCStoreMBean 205 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 206 | 207 | - org.openrewrite.yaml.CommentOutProperty: 208 | propertyKey: weblogic.management.configuration.JMSQueueMBean 209 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 210 | 211 | - org.openrewrite.yaml.CommentOutProperty: 212 | propertyKey: weblogic.management.configuration.JMSStoreMBean 213 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 214 | 215 | - org.openrewrite.yaml.CommentOutProperty: 216 | propertyKey: weblogic.management.configuration.JMSTemplateMBean 217 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 218 | 219 | - org.openrewrite.yaml.CommentOutProperty: 220 | propertyKey: weblogic.management.configuration.JMSTopicMBean 221 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 222 | 223 | - org.openrewrite.yaml.CommentOutProperty: 224 | propertyKey: weblogic.management.configuration.JMSVirtualDestinationMBean 225 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 226 | 227 | - org.openrewrite.yaml.CommentOutProperty: 228 | propertyKey: weblogic.management.runtime.FairShareConstraintRuntimeMBean 229 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 230 | 231 | - org.openrewrite.yaml.CommentOutProperty: 232 | propertyKey: weblogic.management.runtime.JDBCPartitionRuntimeMBean 233 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 234 | 235 | - org.openrewrite.yaml.CommentOutProperty: 236 | propertyKey: weblogic.management.runtime.JDBCProxyDataSourceRuntimeMBean 237 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 238 | 239 | - org.openrewrite.yaml.CommentOutProperty: 240 | propertyKey: weblogic.management.runtime.JTAPartitionRuntimeMBean 241 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 242 | 243 | - org.openrewrite.yaml.CommentOutProperty: 244 | propertyKey: weblogic.management.runtime.KodoDataCacheRuntimeMBean 245 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 246 | 247 | - org.openrewrite.yaml.CommentOutProperty: 248 | propertyKey: weblogic.management.runtime.KodoPersistenceUnitRuntimeMBean 249 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 250 | 251 | - org.openrewrite.yaml.CommentOutProperty: 252 | propertyKey: weblogic.management.runtime.KodoQueryCacheRuntimeMBean 253 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 254 | 255 | - org.openrewrite.yaml.CommentOutProperty: 256 | propertyKey: weblogic.management.runtime.KodoQueryCompilationCacheRuntimeMBean 257 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 258 | 259 | - org.openrewrite.yaml.CommentOutProperty: 260 | propertyKey: weblogic.management.runtime.RecourseActionEventVBean 261 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 262 | 263 | - org.openrewrite.yaml.CommentOutProperty: 264 | propertyKey: weblogic.management.runtime.ResourceManagerRuntimeMBean 265 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 266 | 267 | - org.openrewrite.yaml.CommentOutProperty: 268 | propertyKey: weblogic.management.runtime.ResourceRuntimeMBean 269 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 270 | 271 | - org.openrewrite.yaml.CommentOutProperty: 272 | propertyKey: weblogic.management.runtime.ResourceRuntimeMBean$ResourceType 273 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 274 | 275 | - org.openrewrite.yaml.CommentOutProperty: 276 | propertyKey: weblogic.management.runtime.TriggerRuntimeMBean 277 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 278 | 279 | - org.openrewrite.yaml.CommentOutProperty: 280 | propertyKey: weblogic.rmi.RMISecurityException 281 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 282 | 283 | - org.openrewrite.yaml.CommentOutProperty: 284 | propertyKey: weblogic.rmi.RMISecurityManager 285 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 286 | 287 | - org.openrewrite.yaml.CommentOutProperty: 288 | propertyKey: weblogic.security.providers.authentication.IPlanetAuthenticatorMBean 289 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 290 | 291 | - org.openrewrite.yaml.CommentOutProperty: 292 | propertyKey: weblogic.security.providers.authentication.NovellAuthenticatorMBean 293 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 294 | 295 | - org.openrewrite.yaml.CommentOutProperty: 296 | propertyKey: weblogic.security.providers.authentication.OracleVirtualDirectoryAuthenticatorMBean 297 | commentText: "This property is deprecated and no longer applicable starting from WebLogic Server 14.1.2" 298 | -------------------------------------------------------------------------------- /rewrite-weblogic/README.md: -------------------------------------------------------------------------------- 1 | # Rewrite WebLogic 2 | 3 | [![Maven Central Version](https://img.shields.io/maven-central/v/com.oracle.weblogic.rewrite/rewrite-weblogic)](https://search.maven.org/artifact/com.oracle.weblogic.rewrite/rewrite-weblogic) 4 | ![Dev Version](https://img.shields.io/badge/dynamic/xml?url=https%3A%2F%2Fraw.githubusercontent.com%2Foracle%2Frewrite-recipes%2Frefs%2Fheads%2Fmain%2Frewrite-weblogic%2Fpom.xml&query=%2F*%5Blocal-name()%3D'project'%5D%2F*%5Blocal-name()%3D'version'%5D&prefix=v&label=Dev%20Version) 5 | [![License](https://img.shields.io/badge/License-UPL%201.0-blue.svg)](https://oss.oracle.com/licenses/upl/) 6 | [![GitHub issues](https://img.shields.io/github/issues-raw/oracle/rewrite-recipes)](https://github.com/oracle/rewrite-recipes/issues) 7 | [![Contributing Guide](https://img.shields.io/badge/Contributing-Guide-informational)](https://github.com/oracle/rewrite-recipes/blob/main/CONTRIBUTING.md) 8 | [![Code of Conduct](https://img.shields.io/badge/Code%20of%20Conduct-Oracle%20Community%20Code%20of%20Conduct-informational)](https://www.oracle.com/corporate/community/code-of-conduct.html) 9 | 10 | Migrate your WebLogic applications to the latest version of WebLogic and Java with OpenRewrite. Automatically. 11 | 12 | ## What is this? 13 | 14 | This project implements a [Rewrite module](https://github.com/openrewrite/rewrite) that performs common tasks when 15 | migrating your [WebLogic](https://www.oracle.com/java/weblogic/) applications to a new version of WebLogic Server and Java. 16 | 17 | WebLogic Server application upgrade tooling makes upgrading your WebLogic applications easy. To learn all about it, see the [**Documentation**](./docs/README.md). 18 | 19 | To jump start your hands-on learning, see these **Tutorials**: 20 | 21 | - [Migrate WebLogic Cafe to WLS 14.1.2](https://github.com/oracle-samples/weblogic-examples/blob/main/tutorials/migrate/weblogic-cafe-14.1.2/README.md) 22 | - [Migrate WebLogic Cafe to WLS 15.1.1](https://github.com/oracle-samples/weblogic-examples/blob/main/tutorials/migrate/weblogic-cafe-15.1.1/README.md) 23 | - [Migrate Spring Framework PetClinic to WLS 15.1.1](https://github.com/oracle-samples/weblogic-examples/blob/main/tutorials/migrate/spring-framework-petclinic-15.1.1/README.md) 24 | 25 | ## Recipes for common use cases 26 | 27 | Use these `rewrite-weblogic` recipes to migrate WebLogic Server applications to newer versions of WebLogic Server, Java, Jakarta EE, and related versions of Jakarta Server Faces and Spring Framework. 28 | 29 | > [!NOTE] 30 | > These recipes do not address _any_ other third-party dependencies. For all other third-party dependencies, you _must_ find or create an additional [recipe](https://docs.openrewrite.org/recipes) to do the migration, or make manual code changes after the migration. 31 | 32 | | Use Cases | Recipes | 33 | | --- | ------ | 34 | | Migrate to WebLogic 15.1.1, Jakarta EE 9.1, and Java 21 | [com.oracle.weblogic.rewrite.UpgradeTo1511](./src/main/resources/META-INF/rewrite/weblogic-15.1.1.yaml)
[org.openrewrite.java.migrate.UpgradeToJava21](https://docs.openrewrite.org/recipes/java/migrate/upgradetojava21)
[com.oracle.weblogic.rewrite.JakartaEE9_1](./src/main/resources/META-INF/rewrite/jakarta-ee-9.1.yaml) | 35 | | Migrate to WebLogic 15.1.1, Jakarta EE 9.1, and Java 17 | [com.oracle.weblogic.rewrite.UpgradeTo1511](./src/main/resources/META-INF/rewrite/weblogic-15.1.1.yaml)
[org.openrewrite.java.migrate.UpgradeToJava17](https://docs.openrewrite.org/recipes/java/migrate/upgradetojava21)
[com.oracle.weblogic.rewrite.JakartaEE9_1](./src/main/resources/META-INF/rewrite/jakarta-ee-9.1.yaml) | 36 | | Migrate to WebLogic 15.1.1, Jakarta EE 9.1, Java 21, and Spring Framework 6.2.x and Hibernate | [com.oracle.weblogic.rewrite.UpgradeTo1511](./src/main/resources/META-INF/rewrite/weblogic-15.1.1.yaml)
[org.openrewrite.java.migrate.UpgradeToJava21](https://docs.openrewrite.org/recipes/java/migrate/upgradetojava21)
[com.oracle.weblogic.rewrite.JakartaEE9_1](./src/main/resources/META-INF/rewrite/jakarta-ee-9.1.yaml)
[com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/spring-framework-6.2.yaml)
[com.oracle.weblogic.rewrite.hibernate.MigrateHibernateToJakartaEE9](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/hibernate.yaml) | 37 | | Migrate to WebLogic 15.1.1, Jakarta EE 9.1, Java 17, and Spring Framework 6.2.x and Hibernate | [com.oracle.weblogic.rewrite.UpgradeTo1511](./src/main/resources/META-INF/rewrite/weblogic-15.1.1.yaml)
[org.openrewrite.java.migrate.UpgradeToJava17](https://docs.openrewrite.org/recipes/java/migrate/upgradetojava21)
[com.oracle.weblogic.rewrite.JakartaEE9_1](./src/main/resources/META-INF/rewrite/jakarta-ee-9.1.yaml)
[com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/spring-framework-6.2.yaml)
[com.oracle.weblogic.rewrite.hibernate.MigrateHibernateToJakartaEE9](https://github.com/oracle/rewrite-recipes/blob/main/rewrite-weblogic/src/main/resources/META-INF/rewrite/hibernate.yaml) | 38 | | Migrate to WebLogic 14.1.2 and Java 21 | [com.oracle.weblogic.rewrite.UpgradeTo1412](./src/main/resources/META-INF/rewrite/weblogic-14.1.2.yaml)
[org.openrewrite.java.migrate.UpgradeToJava21](https://docs.openrewrite.org/recipes/java/migrate/upgradetojava21) | 39 | | Migrate to WebLogic 14.1.2 and Java 17 | [com.oracle.weblogic.rewrite.UpgradeTo1412](./src/main/resources/META-INF/rewrite/weblogic-14.1.2.yaml)
[org.openrewrite.java.migrate.UpgradeToJava17](https://docs.openrewrite.org/recipes/java/migrate/upgradetojava17) | 40 | 41 | 42 | 43 | See these recipes for [WebLogic 15.1.1](#weblogic-server-1511-recipes). For more recipes, see [Rewrite WebLogic recipes](./docs/recipes/README.md). 44 | 45 | ## How do I use it? 46 | 47 | You can call OpenRewrite on your code folder using the Maven or Gradle CLI, or include it as a build plug-in in your `pom.xml` or `build.gradle` file. 48 | 49 | For more details on running the recipes with Maven and Gradle, see the [OpenRewrite Quickstart](https://docs.openrewrite.org/running-recipes/getting-started) documentation. 50 | 51 | ### Prerequisites 52 | 53 | The following tools are required to build and run this project: 54 | 55 | - Java 17 or later 56 | - Maven (minimum version 3.6, with recommended version, 3.9.9) or Gradle (version 4.0+) 57 | - Your code 58 | 59 | ### Get your code 60 | 61 | Clone your project to your local machine. 62 | 63 | > [!IMPORTANT] 64 | > Note that the `run` command will make changes to your code. Always make sure you have a backup of your code. When using `git`, create a branch and use `git diff` to see the differences. 65 | 66 | ### Run using the Maven CLI 67 | 68 | > [!TIP] 69 | > If you're using WebLogic artifacts, you need to install the corresponding [WebLogic Maven plug-in](https://docs.oracle.com/en/middleware/fusion-middleware/weblogic-server/14.1.2/wlprg/maven.html#GUID-7759C76C-D6E9-4A7E-BE99-96787814576D) version (for example, 14.1.1). After migration (for example, to 15.1.1), update and sync the plug-in version accordingly, before building the migrated application. 70 | 71 | #### Upgrade applications to WebLogic 14.1.2 and Java 21 72 | 73 | > [!NOTE] 74 | > The `UpgradeTo1412` recipe must be run _after_ the Java recipe. 75 | 76 | ```shell 77 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 78 | -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE,com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST \ 79 | -Drewrite.activeRecipes=org.openrewrite.java.migrate.UpgradeToJava21,com.oracle.weblogic.rewrite.UpgradeTo1412 80 | ``` 81 | 82 | #### Upgrade applications to WebLogic 14.1.2 and Java 17 83 | 84 | ```shell 85 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 86 | -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE,com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST \ 87 | -Drewrite.activeRecipes=org.openrewrite.java.migrate.UpgradeToJava17,com.oracle.weblogic.rewrite.UpgradeTo1412 88 | ``` 89 | 90 | ### Run using Maven with the `` in the `pom.xml` file 91 | 92 | 1. Add the plug-in to your `pom.xml` file and activate the desired recipe from the `rewrite-weblogic` group recipe. The following example illustrates Upgrade to WebLogic 14.1.2 and Upgrade to Java 21. 93 | 94 | ```xml 95 | 96 | org.openrewrite.maven 97 | rewrite-maven-plugin 98 | 6.3.1 99 | 100 | true 101 | 102 | org.openrewrite.java.migrate.UpgradeToJava21 103 | com.oracle.weblogic.rewrite.UpgradeTo1412 104 | 105 | 106 | 107 | 108 | org.openrewrite.recipe 109 | rewrite-migrate-java 110 | 3.4.0 111 | 112 | 113 | com.oracle.weblogic.rewrite 114 | rewrite-weblogic 115 | [0.4.5,) 116 | 117 | 118 | 119 | ``` 120 | 121 | 2. Run the recipe with 122 | `mvn rewrite:run`. 123 | 124 | > [!TIP] 125 | > If you just want to dry run the recipe without changing the code, use `mvn rewrite:DryRun`. For more details when using Maven, see [here](https://docs.openrewrite.org/reference/rewrite-maven-plugin). 126 | 127 | - If you are using `git` for your repository, you can see the differences by using `git diff` or other diff viewers. This option will show you the differences between your original and migrated code. 128 | 129 | ### Run using Gradle 130 | 131 | The following example illustrates using Gradle to run the Upgrade to WebLogic 14.1.2 and Upgrade to Java 21 recipes. 132 | 133 | 1. Add the following to your `build.gradle` file: 134 | 135 | ``` 136 | plugins { 137 | id("org.openrewrite.rewrite") version("7.2.0") 138 | } 139 | 140 | rewrite { 141 | activeRecipe("org.openrewrite.java.migrate.UpgradeToJava21") 142 | activeRecipe("com.oracle.weblogic.rewrite.UpgradeTo1412") 143 | setExportDatatables(true) 144 | } 145 | 146 | repositories { 147 | mavenCentral() 148 | } 149 | 150 | dependencies { 151 | rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.4.0") 152 | rewrite("com.oracle.weblogic.rewrite:rewrite-weblogic:+") 153 | } 154 | ``` 155 | 2. Run `gradle rewriteRun` to run the recipe. 156 | 157 | > [!TIP] 158 | > If you just want to dry run the recipe without changing the code, use `gradle rewriteDryRun`. For more details about the "dryRun" task, see [here](https://docs.openrewrite.org/reference/gradle-plugin-configuration#the-dryrun-task). 159 | 160 | > [!NOTE] 161 | > You can run `rewrite` on a Gradle project without modifying the build, similar to using the `mvn` CLI command. For more information, see https://docs.openrewrite.org/running-recipes/running-rewrite-on-a-gradle-project-without-modifying-the-build. 162 | 163 | ## WebLogic Server 15.1.1 recipes 164 | 165 | > [!WARNING] 166 | > Before deploying a migrated application, make sure that you are using an approved WebLogic Server 15.1.1 installation. 167 | 168 | > [!NOTE] 169 | > When upgrading to WebLogic Server 15.1.1, the `UpgradeTo1511` recipe must be run _after_ the Java and Jakarta recipes. 170 | 171 | #### Upgrade applications to WebLogic Server 15.1.1, Jakarta EE 9.1, and Java 21 172 | 173 | ```shell 174 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 175 | -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE,com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST \ 176 | -Drewrite.activeRecipes=org.openrewrite.java.migrate.UpgradeToJava21,com.oracle.weblogic.rewrite.JakartaEE9_1,com.oracle.weblogic.rewrite.UpgradeTo1511 \ 177 | -Drewrite.exportDatatables=true 178 | ``` 179 | 180 | #### Upgrade applications to WebLogic Server 15.1.1, Jakarta EE 9.1, and Java 17 181 | 182 | ```shell 183 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 184 | -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE,com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST \ 185 | -Drewrite.activeRecipes=org.openrewrite.java.migrate.UpgradeToJava17,com.oracle.weblogic.rewrite.JakartaEE9_1,com.oracle.weblogic.rewrite.UpgradeTo1511 \ 186 | -Drewrite.exportDatatables=true 187 | ``` 188 | 189 | 190 | #### **Spring Framework upgrade:** Upgrade applications to WebLogic Server 15.1.1, Jakarta EE 9.1, Java 21, and Spring Framework 6.2.x 191 | 192 | If your application is running with Spring Framework 5.x on WebLogic 12.x or 14.x, and you want to migrate to Spring Framework 6.2.x, add the Spring Framework recipe to the command: 193 | 194 | ```shell 195 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 196 | -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE,com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST,org.openrewrite.recipe:rewrite-spring:RELEASE \ 197 | -Drewrite.activeRecipes=org.openrewrite.java.migrate.UpgradeToJava21,com.oracle.weblogic.rewrite.JakartaEE9_1,com.oracle.weblogic.rewrite.UpgradeTo1511,com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2 \ 198 | -Drewrite.exportDatatables=true 199 | ``` 200 | 201 | > [!TIP] 202 | > When upgrading your application to Spring Framework 6.2.x, you may have other libraries that need to be updated. You can include the recipe in the same command, like `org.hibernate`, or run other third-party libraries separately. For other examples, see the [tutorials](https://github.com/oracle-samples/weblogic-examples). 203 | 204 | #### **Spring Framework upgrade:** Upgrade applications to WebLogic Server 15.1.1, Jakarta EE 9.1, Java 17, and Spring Framework 6.2.x 205 | 206 | If your application is running with Spring Framework 5.x on WebLogic 12.x or 14.x, and you want to migrate to Spring Framework 6.2.x, add the Spring Framework recipe to the command: 207 | 208 | ```shell 209 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 210 | -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE,com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST,org.openrewrite.recipe:rewrite-spring:RELEASE \ 211 | -Drewrite.activeRecipes=org.openrewrite.java.migrate.UpgradeToJava17,com.oracle.weblogic.rewrite.JakartaEE9_1,com.oracle.weblogic.rewrite.UpgradeTo1511,com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2 \ 212 | -Drewrite.exportDatatables=true 213 | ``` 214 | 215 | > [!TIP] 216 | > When upgrading your application to Spring Framework 6.2.x, you may have other libraries that need to be updated. You can include the recipe in the same command, like `org.hibernate`, or run other third-party libraries separately. For other examples, see the [tutorials](https://github.com/oracle-samples/weblogic-examples). 217 | 218 | 219 | #### Spring Framework and Hibernate upgrade 220 | 221 | This example includes the Hibernate recipe running with the WebLogic 15.1.1, Java 21, and Spring Framework 6.2 recipes. 222 | 223 | ```shell 224 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 225 | -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE,com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST,org.openrewrite.recipe:rewrite-spring:RELEASE,org.openrewrite.recipe:rewrite-hibernate:RELEASE \ 226 | -Drewrite.activeRecipes=org.openrewrite.java.migrate.UpgradeToJava21,com.oracle.weblogic.rewrite.JakartaEE9_1,com.oracle.weblogic.rewrite.UpgradeTo1511,com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2,com.oracle.weblogic.rewrite.hibernate.MigrateHibernateToJakartaEE9 \ 227 | -Drewrite.exportDatatables=true 228 | ``` 229 | 230 | This example includes the Hibernate recipe running with the WebLogic 15.1.1, Java 17, and Spring Framework 6.2 recipes. 231 | 232 | ```shell 233 | mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \ 234 | -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-migrate-java:RELEASE,com.oracle.weblogic.rewrite:rewrite-weblogic:LATEST,org.openrewrite.recipe:rewrite-spring:RELEASE,org.openrewrite.recipe:rewrite-hibernate:RELEASE \ 235 | -Drewrite.activeRecipes=org.openrewrite.java.migrate.UpgradeToJava17,com.oracle.weblogic.rewrite.JakartaEE9_1,com.oracle.weblogic.rewrite.UpgradeTo1511,com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2,com.oracle.weblogic.rewrite.hibernate.MigrateHibernateToJakartaEE9 \ 236 | -Drewrite.exportDatatables=true 237 | ``` 238 | 239 | 240 | ## Developing, contributing, and testing this recipe locally 241 | ![Dev Version](https://img.shields.io/badge/dynamic/xml?url=https%3A%2F%2Fraw.githubusercontent.com%2Foracle%2Frewrite-recipes%2Frefs%2Fheads%2Fmain%2Frewrite-weblogic%2Fpom.xml&query=%2F*%5Blocal-name()%3D'project'%5D%2F*%5Blocal-name()%3D'version'%5D&prefix=v&label=Dev%20Version) 242 | [![GitHub issues](https://img.shields.io/github/issues-raw/oracle/rewrite-recipes)](https://github.com/oracle/rewrite-recipes/issues) 243 | [![Contributing Guide](https://img.shields.io/badge/Contributing-Guide-informational)](https://github.com/oracle/rewrite-recipes/blob/main/CONTRIBUTING.md) 244 | [![Code of Conduct](https://img.shields.io/badge/Code%20of%20Conduct-Oracle%20Community%20Code%20of%20Conduct-informational)](https://www.oracle.com/corporate/community/code-of-conduct.html) 245 | 246 | ### Prerequisites 247 | 248 | The following tools are required to build and run this project: 249 | 250 | - JDK (version 1.8 or later) 251 | - Maven (version 3.2+) or Gradle (version 4.0+ ) 252 | - Your code 253 | 254 | #### Dry run 255 | 256 | ```shell 257 | mvn org.openrewrite.maven:rewrite-maven-plugin:dryRun 258 | ``` 259 | 260 | #### Run (apply changes) 261 | 262 | ```shell 263 | mvn org.openrewrite.maven:rewrite-maven-plugin:run 264 | ``` 265 | 266 | #### Testing 267 | 268 | ```shell 269 | mvn test 270 | ``` 271 | 272 | ## License 273 | 274 | Copyright (c) 2025 Oracle and/or its affiliates. 275 | 276 | Released under the Universal Permissive License v1.0 as shown at 277 | . 278 | -------------------------------------------------------------------------------- /rewrite-weblogic/src/main/resources/META-INF/rewrite/weblogic-15.1.1.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. 3 | 4 | # Licensed under the Universal Permissive License v 1.0 as shown at 5 | # https://oss.oracle.com/licenses/upl. 6 | 7 | # Subject to the condition set forth below, permission is hereby granted to any 8 | # person obtaining a copy of this software, associated documentation and/or data 9 | # (collectively the "Software"), free of charge and under any and all copyright 10 | # rights in the Software, and any and all patent rights owned or freely 11 | # licensable by each licensor hereunder covering either (i) the unmodified 12 | # Software as contributed to or provided by such licensor, or (ii) the Larger 13 | # Works (as defined below), to deal in both 14 | 15 | # (a) the Software, and 16 | # (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | # one is included with the Software (each a "Larger Work" to which the Software 18 | # is contributed by such licensors), 19 | 20 | # without restriction, including without limitation the rights to copy, create 21 | # derivative works of, display, perform, and distribute the Software and make, 22 | # use, sell, offer for sale, import, export, have made, and have sold the 23 | # Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | # either these or other terms. 25 | 26 | # This license is subject to the following condition: 27 | # The above copyright notice and either this complete permission notice or at 28 | # a minimum a reference to the UPL must be included in all copies or 29 | # substantial portions of the Software. 30 | 31 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | # SOFTWARE. 38 | --- 39 | type: specs.openrewrite.org/v1beta/recipe 40 | name: com.oracle.weblogic.rewrite.UpgradeTo1511 41 | displayName: Migrate to WebLogic 15.1.1 42 | description: This recipe will apply changes required for migrating to WebLogic 15.1.1 and Jakarta EE 9.1 43 | tags: 44 | - weblogic 45 | - java 46 | recipeList: 47 | - com.oracle.weblogic.rewrite.OutputRecipeVersion 48 | - com.oracle.weblogic.rewrite.UpdateBuildToWebLogic1511 49 | - com.oracle.weblogic.rewrite.CheckAndCommentOutDeprecations1511 50 | - com.oracle.weblogic.rewrite.MigrateWebLogicSchemasTo1511 51 | - com.oracle.weblogic.rewrite.ChangeJakartaInjectAPIDependencyScope 52 | - com.oracle.weblogic.rewrite.ChangeJAXBBindAPIDependencyScope 53 | - com.oracle.weblogic.rewrite.ChangeJakartaWebServiceRSAPIDependencyScope 54 | --- 55 | type: specs.openrewrite.org/v1beta/recipe 56 | name: com.oracle.weblogic.rewrite.UpdateBuildToWebLogic1511 57 | displayName: Update the WebLogic version to 15.1.1 58 | description: This recipe will update the WebLogic version to 15.1.1 for Maven build. 59 | recipeList: 60 | - com.oracle.weblogic.rewrite.UpgradeWeblogicMavenPropertyVersion: 61 | newVersion: 15.1.1-0-0 62 | - org.openrewrite.maven.ChangePropertyValue: 63 | key: weblogic.version 64 | newValue: 15.1.1-0-0 65 | - org.openrewrite.maven.UpgradeParentVersion: 66 | groupId: com.oracle.weblogic.archetype 67 | artifactId: '*' 68 | newVersion: 15.1.1-0-0 69 | - org.openrewrite.maven.UpgradePluginVersion: 70 | groupId: com.oracle.weblogic 71 | artifactId: '*' 72 | newVersion: 15.1.1-0-0 73 | trustParent: "True" 74 | - org.openrewrite.java.dependencies.UpgradeDependencyVersion: 75 | groupId: com.oracle.weblogic 76 | artifactId: '*' 77 | newVersion: 15.1.1-0-0 78 | --- 79 | type: specs.openrewrite.org/v1beta/recipe 80 | name: com.oracle.weblogic.rewrite.MigrateWebLogicSchemasTo1511 81 | displayName: Migrate WebLogic Schemas to 15.1.1 82 | description: This recipe will migrate WebLogic schemas to 15.1.1 83 | tags: 84 | - weblogic 85 | - schemas 86 | - descriptors 87 | - java 88 | recipeList: 89 | - com.oracle.weblogic.rewrite.WebLogicXmlWebAppNamespace1511 90 | - com.oracle.weblogic.rewrite.WebLogicEjbJar32XmlNamespace1511 91 | - com.oracle.weblogic.rewrite.WebLogicRdbmsJarXmlNamespace1511 92 | - com.oracle.weblogic.rewrite.WebLogicPersistenceConfigurationXmlNamespace1511 93 | - com.oracle.weblogic.rewrite.WebLogicWebServicesXmlNamespace1511 94 | - com.oracle.weblogic.rewrite.WebLogicWseeClientHandlerChainXmlNamespace1511 95 | - com.oracle.weblogic.rewrite.WebLogicWebservicesPolicyRefXmlNamespace1511 96 | - com.oracle.weblogic.rewrite.WebLogicWseeStandaloneClientXmlNamespace1511 97 | - com.oracle.weblogic.rewrite.WebLogicRaXmlNamespace1511 98 | - com.oracle.weblogic.rewrite.WebLogicApplicationXmlNamespace1511 99 | - com.oracle.weblogic.rewrite.WebLogicApplicationClientXmlNamespace1511 100 | - com.oracle.weblogic.rewrite.WebLogicPubSubXmlNamespace1511 101 | - com.oracle.weblogic.rewrite.WebLogicJmsXmlNamespace1511 102 | - com.oracle.weblogic.rewrite.WebLogicJdbcXmlNamespace1511 103 | - com.oracle.weblogic.rewrite.WebLogicPlanXmlNamespace1511 104 | - com.oracle.weblogic.rewrite.WebLogicResourceDeploymentPlanXmlNamespace1511 105 | --- 106 | type: specs.openrewrite.org/v1beta/recipe 107 | name: com.oracle.weblogic.rewrite.WebLogicXmlWebAppNamespace1511 108 | displayName: Migrate xmlns entries in `weblogic.xml` files to WebLogic 15.1.1 109 | description: This recipe will update the `xmlns` entries in `weblogic.xml` files to WebLogic 15.1.1 110 | tags: 111 | - weblogic 112 | - web-app 113 | - schemas 114 | recipeList: 115 | - com.oracle.weblogic.rewrite.WebLogicXmlWebAppNamespace1412 116 | - org.openrewrite.text.FindAndReplace: 117 | find: javax. 118 | replace: jakarta. 119 | filePattern: '**/weblogic.xml' 120 | --- 121 | type: specs.openrewrite.org/v1beta/recipe 122 | name: com.oracle.weblogic.rewrite.WebLogicEjbJar32XmlNamespace1511 123 | displayName: Migrate xmlns entries in `weblogic-ejb-jar.xml` files to WebLogic 15.1.1 124 | description: This recipe will update the `xmlns` entries in `weblogic-ejb-jar.xml` files to WebLogic 15.1.1 125 | tags: 126 | - weblogic 127 | - ejb-jar 128 | - schemas 129 | recipeList: 130 | - com.oracle.weblogic.rewrite.WebLogicEjbJar32XmlNamespace1412 131 | - org.openrewrite.text.FindAndReplace: 132 | find: javax. 133 | replace: jakarta. 134 | filePattern: '**/weblogic-ejb-jar.xml' 135 | --- 136 | type: specs.openrewrite.org/v1beta/recipe 137 | name: com.oracle.weblogic.rewrite.WebLogicRdbmsJarXmlNamespace1511 138 | displayName: Migrate xmlns entries in `weblogic-rdbms-jar.xml` files to WebLogic 15.1.1 139 | description: This recipe will update the `xmlns` entries in `weblogic-rdbms-jar.xml` files to WebLogic 15.1.1 140 | tags: 141 | - weblogic 142 | - rdbms-jar 143 | - schemas 144 | recipeList: 145 | - com.oracle.weblogic.rewrite.WebLogicRdbmsJarXmlNamespace1412 146 | - org.openrewrite.text.FindAndReplace: 147 | find: javax. 148 | replace: jakarta. 149 | filePattern: '**/weblogic-rdbms-jar.xml' 150 | --- 151 | type: specs.openrewrite.org/v1beta/recipe 152 | name: com.oracle.weblogic.rewrite.WebLogicPersistenceConfigurationXmlNamespace1511 153 | displayName: Migrate xmlns entries in `persistence-configuration.xml` files to WebLogic 15.1.1 154 | description: This recipe will update the `xmlns` entries in `persistence-configuration.xml` files to WebLogic 15.1.1 155 | tags: 156 | - weblogic 157 | - persistence-configuration 158 | - schemas 159 | recipeList: 160 | - com.oracle.weblogic.rewrite.WebLogicPersistenceConfigurationXmlNamespace1412 161 | - org.openrewrite.text.FindAndReplace: 162 | find: javax. 163 | replace: jakarta. 164 | filePattern: '**/persistence-configuration.xml' 165 | --- 166 | type: specs.openrewrite.org/v1beta/recipe 167 | name: com.oracle.weblogic.rewrite.WebLogicWebServicesXmlNamespace1511 168 | displayName: Migrate xmlns entries in `weblogic-webservices.xml` files to WebLogic 15.1.1 169 | description: This recipe will update the `xmlns` entries in `weblogic-webservices.xml` files to WebLogic 15.1.1 170 | tags: 171 | - weblogic 172 | - webservices 173 | - schemas 174 | recipeList: 175 | - com.oracle.weblogic.rewrite.WebLogicWebServicesXmlNamespace1412 176 | - org.openrewrite.text.FindAndReplace: 177 | find: javax. 178 | replace: jakarta. 179 | filePattern: '**/weblogic-webservices.xml' 180 | --- 181 | type: specs.openrewrite.org/v1beta/recipe 182 | name: com.oracle.weblogic.rewrite.WebLogicWseeClientHandlerChainXmlNamespace1511 183 | displayName: Migrate xmlns entries in `weblogic-wsee-clientHandlerChain.xml` files to WebLogic 15.1.1 184 | description: This recipe will update the `xmlns` entries in `weblogic-wsee-clientHandlerChain.xml` files to WebLogic 15.1.1 185 | tags: 186 | - weblogic 187 | - wsee-clientHandlerChain 188 | - schemas 189 | recipeList: 190 | - com.oracle.weblogic.rewrite.WebLogicWseeClientHandlerChainXmlNamespace1412 191 | - org.openrewrite.text.FindAndReplace: 192 | find: javax. 193 | replace: jakarta. 194 | filePattern: '**/weblogic-wsee-clientHandlerChain.xml' 195 | --- 196 | type: specs.openrewrite.org/v1beta/recipe 197 | name: com.oracle.weblogic.rewrite.WebLogicWebservicesPolicyRefXmlNamespace1511 198 | displayName: Migrate xmlns entries in `weblogic-webservices-policy.xml` files to WebLogic 15.1.1 199 | description: This recipe will update the `xmlns` entries in `weblogic-webservices-policy.xml` files to WebLogic 15.1.1 200 | tags: 201 | - weblogic 202 | - webservices-policy 203 | - schemas 204 | recipeList: 205 | - com.oracle.weblogic.rewrite.WebLogicWebservicesPolicyRefXmlNamespace1412 206 | - org.openrewrite.text.FindAndReplace: 207 | find: javax. 208 | replace: jakarta. 209 | filePattern: '**/weblogic-webservices-policy.xml' 210 | --- 211 | type: specs.openrewrite.org/v1beta/recipe 212 | name: com.oracle.weblogic.rewrite.WebLogicWseeStandaloneClientXmlNamespace1511 213 | displayName: Migrate xmlns entries in `weblogic-wsee-standaloneclient.xml` files to WebLogic 15.1.1 214 | description: This recipe will update the `xmlns` entries in `weblogic-wsee-standaloneclient.xml` files to WebLogic 15.1.1 215 | tags: 216 | - weblogic 217 | - wsee-standaloneclient 218 | - schemas 219 | recipeList: 220 | - com.oracle.weblogic.rewrite.WebLogicWseeStandaloneClientXmlNamespace1412 221 | - org.openrewrite.text.FindAndReplace: 222 | find: javax. 223 | replace: jakarta. 224 | filePattern: '**/weblogic-wsee-standaloneclient.xml' 225 | --- 226 | type: specs.openrewrite.org/v1beta/recipe 227 | name: com.oracle.weblogic.rewrite.WebLogicRaXmlNamespace1511 228 | displayName: Migrate xmlns entries in `weblogic-ra.xml` files to WebLogic 15.1.1 229 | description: This recipe will update the `xmlns` entries in `weblogic-ra.xml` files to WebLogic 15.1.1 230 | tags: 231 | - weblogic 232 | - ra 233 | - connector 234 | - schemas 235 | recipeList: 236 | - com.oracle.weblogic.rewrite.WebLogicRaXmlNamespace1412 237 | - org.openrewrite.text.FindAndReplace: 238 | find: javax. 239 | replace: jakarta. 240 | filePattern: '**/weblogic-ra.xml' 241 | --- 242 | type: specs.openrewrite.org/v1beta/recipe 243 | name: com.oracle.weblogic.rewrite.WebLogicApplicationXmlNamespace1511 244 | displayName: Migrate xmlns entries in `weblogic-application.xml` files to WebLogic 15.1.1 245 | description: This recipe will update the `xmlns` entries in `weblogic-application.xml` files to WebLogic 15.1.1 246 | tags: 247 | - weblogic 248 | - application 249 | - schemas 250 | recipeList: 251 | - com.oracle.weblogic.rewrite.WebLogicApplicationXmlNamespace1412 252 | - org.openrewrite.text.FindAndReplace: 253 | find: javax. 254 | replace: jakarta. 255 | filePattern: '**/weblogic-application.xml' 256 | --- 257 | type: specs.openrewrite.org/v1beta/recipe 258 | name: com.oracle.weblogic.rewrite.WebLogicApplicationClientXmlNamespace1511 259 | displayName: Migrate xmlns entries in `application-client.xml` files to WebLogic 15.1.1 260 | description: This recipe will update the `xmlns` entries in `application-client.xml` files to WebLogic 15.1.1 261 | tags: 262 | - weblogic 263 | - application-client 264 | - schemas 265 | recipeList: 266 | - com.oracle.weblogic.rewrite.WebLogicApplicationClientXmlNamespace1412 267 | - org.openrewrite.text.FindAndReplace: 268 | find: javax. 269 | replace: jakarta. 270 | filePattern: '**/application-client.xml' 271 | --- 272 | type: specs.openrewrite.org/v1beta/recipe 273 | name: com.oracle.weblogic.rewrite.WebLogicPubSubXmlNamespace1511 274 | displayName: Migrate xmlns entries in `weblogic-pubsub.xml` files to WebLogic 15.1.1 275 | description: This recipe will update the `xmlns` entries in `weblogic-pubsub.xml` files to WebLogic 15.1.1 276 | tags: 277 | - weblogic 278 | - pubsub 279 | - schemas 280 | recipeList: 281 | - com.oracle.weblogic.rewrite.WebLogicPubSubXmlNamespace1412 282 | - org.openrewrite.text.FindAndReplace: 283 | find: javax. 284 | replace: jakarta. 285 | filePattern: '**/weblogic-pubsub.xml' 286 | --- 287 | type: specs.openrewrite.org/v1beta/recipe 288 | name: com.oracle.weblogic.rewrite.WebLogicJmsXmlNamespace1511 289 | displayName: Migrate xmlns entries in `*-jms.xml` files to WebLogic 15.1.1 290 | description: This recipe will update the `xmlns` entries in `*-jms.xml` files to WebLogic 15.1.1 291 | tags: 292 | - weblogic 293 | - jms 294 | - schemas 295 | recipeList: 296 | - com.oracle.weblogic.rewrite.WebLogicJmsXmlNamespace1412 297 | - org.openrewrite.text.FindAndReplace: 298 | find: javax. 299 | replace: jakarta. 300 | filePattern: '**/*-jms.xml' 301 | --- 302 | type: specs.openrewrite.org/v1beta/recipe 303 | name: com.oracle.weblogic.rewrite.WebLogicJdbcXmlNamespace1511 304 | displayName: Migrate xmlns entries in `*-jdbc.xml` files to WebLogic 15.1.1 305 | description: This recipe will update the `xmlns` entries in `*-jdbc.xml` files to WebLogic 15.1.1 306 | tags: 307 | - weblogic 308 | - jdbc 309 | - schemas 310 | recipeList: 311 | - com.oracle.weblogic.rewrite.WebLogicJdbcXmlNamespace1412 312 | - org.openrewrite.text.FindAndReplace: 313 | find: javax. 314 | replace: jakarta. 315 | filePattern: '**/*-jdbc.xml' 316 | --- 317 | type: specs.openrewrite.org/v1beta/recipe 318 | name: com.oracle.weblogic.rewrite.WebLogicPlanXmlNamespace1511 319 | displayName: Migrate xmlns entries in `plan.xml` files to WebLogic 15.1.1 320 | description: This recipe will update the `xmlns` entries in `plan.xml` files to WebLogic 15.1.1 321 | tags: 322 | - weblogic 323 | - deployment-plan 324 | - schemas 325 | recipeList: 326 | - com.oracle.weblogic.rewrite.WebLogicPlanXmlNamespace1412 327 | - org.openrewrite.text.FindAndReplace: 328 | find: javax. 329 | replace: jakarta. 330 | filePattern: '**/plan.xml' 331 | --- 332 | type: specs.openrewrite.org/v1beta/recipe 333 | name: com.oracle.weblogic.rewrite.WebLogicResourceDeploymentPlanXmlNamespace1511 334 | displayName: Migrate xmlns entries in `resource-deployment-plan.xml` files to WebLogic 15.1.1 335 | description: This recipe will update the `xmlns` entries in `resource-deployment-plan.xml` files to WebLogic 15.1.1 336 | tags: 337 | - weblogic 338 | - resource-deployment-plan 339 | - schemas 340 | recipeList: 341 | - com.oracle.weblogic.rewrite.WebLogicResourceDeploymentPlanXmlNamespace1412 342 | - org.openrewrite.text.FindAndReplace: 343 | find: javax. 344 | replace: jakarta. 345 | filePattern: '**/resource-deployment-plan.xml' 346 | --- 347 | type: specs.openrewrite.org/v1beta/recipe 348 | name: com.oracle.weblogic.rewrite.ChangeJakartaInjectAPIDependencyScope 349 | displayName: Change the jakarta.inject-api dependency to scope provided when jakartaee-api 9.x is provided. 350 | description: This recipe will change the jakarta.inject-api dependency scope to provided when jakarta.jakartaee-api version 9.x is provided in WebLogic 15.1.1. This prevents the jakarta.inject-api jar from being deployed to WebLogic which can cause class conflicts. 351 | tags: 352 | - weblogic 353 | preconditions: 354 | - org.openrewrite.java.dependencies.DependencyInsight: 355 | groupIdPattern: jakarta.platform 356 | artifactIdPattern: jakarta.jakartaee-api 357 | version: 9.x 358 | scope: provided 359 | recipeList: 360 | - org.openrewrite.maven.ChangeDependencyScope: 361 | groupId: jakarta.inject 362 | artifactId: jakarta.inject-api 363 | newScope: provided 364 | --- 365 | type: specs.openrewrite.org/v1beta/recipe 366 | name: com.oracle.weblogic.rewrite.ChangeJAXBBindAPIDependencyScope 367 | displayName: Change the jakarta.xml.bind-api dependency to scope provided when jakartaee-api 9.x is provided. 368 | description: This recipe will change the jakarta.xml.bind-api dependency scope to provided when jakarta.jakartaee-api version 9.x is provided in WebLogic 15.1.1. This prevents the jakarta.xml.bind-api jar from being deployed to WebLogic which can cause class conflicts. 369 | tags: 370 | - weblogic 371 | preconditions: 372 | - org.openrewrite.java.dependencies.DependencyInsight: 373 | groupIdPattern: jakarta.platform 374 | artifactIdPattern: jakarta.jakartaee-api 375 | version: 9.x 376 | scope: provided 377 | recipeList: 378 | - org.openrewrite.maven.ChangeDependencyScope: 379 | groupId: jakarta.xml.bind 380 | artifactId: jakarta.xml.bind-api 381 | newScope: provided 382 | --- 383 | type: specs.openrewrite.org/v1beta/recipe 384 | name: com.oracle.weblogic.rewrite.ChangeJakartaWebServiceRSAPIDependencyScope 385 | displayName: Change the jakarta.ws.rs-api dependency to scope provided when jakartaee-api 9.x is provided. 386 | description: This recipe will change the jakarta.ws.rs-api dependency scope to provided when jakarta.jakartaee-api version 9.x is provided in WebLogic 15.1.1. This prevents the jakarta.ws.rs-api jar from being deployed to WebLogic which can cause class conflicts. 387 | tags: 388 | - weblogic 389 | preconditions: 390 | - org.openrewrite.java.dependencies.DependencyInsight: 391 | groupIdPattern: jakarta.platform 392 | artifactIdPattern: jakarta.jakartaee-api 393 | version: 9.x 394 | scope: provided 395 | recipeList: 396 | - org.openrewrite.maven.ChangeDependencyScope: 397 | groupId: jakarta.ws.rs 398 | artifactId: jakarta.ws.rs-api 399 | newScope: provided 400 | --- 401 | type: specs.openrewrite.org/v1beta/recipe 402 | name: com.oracle.weblogic.rewrite.WebLogicXmlCreateIfNotExists1511 403 | displayName: Create `weblogic.xml` if it does not exist 404 | description: This recipe will create a `weblogic.xml` file with the WebLogic 15.1.1 namespace if it does not already exist. 405 | tags: 406 | - weblogic 407 | - web-app 408 | - schemas 409 | recipeList: 410 | - org.openrewrite.xml.CreateXmlFile: 411 | relativeFileName: src/main/webapp/WEB-INF/weblogic.xml 412 | fileContents: > 413 | 414 | 418 | 419 | overwriteExisting: false 420 | --- 421 | type: specs.openrewrite.org/v1beta/recipe 422 | name: com.oracle.weblogic.rewrite.WebLogicXmlPreferApplicationPackagesJPA 423 | displayName: Add `prefer-application-packages` for JPA in `weblogic.xml` 424 | description: This recipe will add a `prefer-application-packages` entry for Jakarta Persistence in `weblogic.xml` if it does not already exist. 425 | tags: 426 | - weblogic 427 | - web-app 428 | - schemas 429 | preconditions: 430 | - org.openrewrite.FindSourceFiles: 431 | filePattern: '**/weblogic.xml' 432 | recipeList: 433 | - org.openrewrite.xml.AddOrUpdateChildTag: 434 | parentXPath: /weblogic-web-app 435 | newChildTag: 436 | replaceExisting: false 437 | - org.openrewrite.xml.AddOrUpdateChildTag: 438 | parentXPath: /weblogic-web-app//container-descriptor 439 | newChildTag: 440 | replaceExisting: false 441 | - org.openrewrite.xml.AddOrUpdateChildTag: 442 | parentXPath: /weblogic-web-app//container-descriptor//prefer-application-packages 443 | newChildTag: jakarta.persistence.* 444 | replaceExisting: false 445 | --- 446 | type: specs.openrewrite.org/v1beta/recipe 447 | name: com.oracle.weblogic.rewrite.WebLogicXmlPreferApplicationPackagesSlf4j 448 | displayName: Add `prefer-application-packages` for SLF4J in `weblogic.xml` 449 | description: This recipe will add a `prefer-application-packages` entry for SLF4J in `weblogic.xml` if it does not already exist. 450 | tags: 451 | - weblogic 452 | - web-app 453 | - schemas 454 | preconditions: 455 | - org.openrewrite.FindSourceFiles: 456 | filePattern: '**/weblogic.xml' 457 | recipeList: 458 | - org.openrewrite.xml.AddOrUpdateChildTag: 459 | parentXPath: /weblogic-web-app 460 | newChildTag: 461 | replaceExisting: false 462 | - org.openrewrite.xml.AddOrUpdateChildTag: 463 | parentXPath: /weblogic-web-app//container-descriptor 464 | newChildTag: 465 | replaceExisting: false 466 | - org.openrewrite.xml.AddOrUpdateChildTag: 467 | parentXPath: /weblogic-web-app//container-descriptor//prefer-application-packages 468 | newChildTag: org.slf4j.* 469 | replaceExisting: false 470 | --- --------------------------------------------------------------------------------