• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

openrewrite/rewrite-maven-plugin: Eliminate technical debt. At build time.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

openrewrite/rewrite-maven-plugin

开源软件地址(OpenSource Url):

https://github.com/openrewrite/rewrite-maven-plugin

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

Logo

Eliminate Tech-Debt. At build time.

ci Apache 2.0 Maven Central

What is this?

This project provides a Maven plugin that applies Rewrite checking and fixing tasks as build tasks, one of several possible workflows for propagating change across an organization's source code.

Getting started

This README may not have the most up-to-date documentation. For the most up-to-date documentation and reference guides, see:

To configure, add the plugin to your POM:

<?xml version="1.0" encoding="UTF-8"?>
<project>
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>org.openrewrite.maven</groupId>
                <artifactId>rewrite-maven-plugin</artifactId>
                <version><!-- latest version here --></version>
                <configuration>
                    <activeRecipes>
                        <recipe>org.openrewrite.java.format.AutoFormat</recipe>
                    </activeRecipes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

If wanting to leverage recipes from other dependencies:

<?xml version="1.0" encoding="UTF-8"?>
<project>
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>org.openrewrite.maven</groupId>
                <artifactId>rewrite-maven-plugin</artifactId>
                <version><!-- latest version here --></version>
                <configuration>
                    <activeRecipes>
                        <recipe>org.openrewrite.java.testing.junit5.JUnit5BestPractices</recipe>
                        <recipe>org.openrewrite.github.ActionsSetupJavaAdoptOpenJDKToTemurin</recipe>
                    </activeRecipes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-testing-frameworks</artifactId>
                        <version><!-- latest dependency version here --></version>
                    </dependency>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-github-actions</artifactId>
                        <version><!-- latest dependency version here --></version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
</project>

To get started, try mvn rewrite:help, mvn rewrite:discover, mvn rewrite:dryRun, mvn rewrite:run, among other plugin goals.

See the Maven Plugin Configuration documentation for full configuration and usage options.

Snapshots

To use the latest -SNAPSHOT version, add a <pluginRepositories> entry for OSSRH snapshots. For example:

<?xml version="1.0" encoding="UTF-8"?>
<project>
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>org.openrewrite.maven</groupId>
                <artifactId>rewrite-maven-plugin</artifactId>
                <!-- Use whichever version is latest at the time of reading. This number is a placeholder. -->
                <version>4.17.0-SNAPSHOT</version>
                <configuration>
                    <activeRecipes>
                        <recipe>org.openrewrite.java.logging.slf4j.Log4j2ToSlf4j</recipe>
                    </activeRecipes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-testing-frameworks</artifactId>
                        <!-- Use whichever version is latest at the time of reading. This number is a placeholder. -->
                        <version>1.1.0-SNAPSHOT</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <pluginRepositories>
        <pluginRepository>
            <id>ossrh-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </pluginRepository>
    </pluginRepositories>

</project>

Notes for developing and testing this plugin

This plugin uses the Maven Integration Testing Framework Extension for tests.

All tests can be run from the command line using:

./mvnw verify

If you're looking for more information on the output from a test, try checking the target/maven-it/**/*IT/** directory contents after running the tests. It will contain the project state output, including maven logs, etc. Check the Integration Testing Framework Users Guide for information, too. It's good.

Using this plugin against itself

The pom.xml file contains a bootstrap profile to use the rewrite-maven-plugin against itself (it's a helpful plugin, why not use it to help develop itself?).

./mvnw -Pbootstrap rewrite:dryRun

Resource guides




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
akikeadk/maven-project: jleetutorial/maven-project发布时间:2022-08-17
下一篇:
kvvgoud/SeleniumProject: Selenium-Maven-Jenkins Integration Practice发布时间:2022-08-17
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap