简体   繁体   English

如何将 maven 插件从 maven 迁移到 gradle

[英]How to migrate maven plugins form maven to gradle

I am migrating my spring boot project from maven to gradle. I have done dependencies migration, but have problems with plugin migration.我正在将我的 spring 引导项目从 8833696712888 迁移到 gradle。我已经完成了依赖项迁移,但是插件迁移有问题。 Need an assistanse.需要一个助手。 Also if there any real example with comparing maven and gradle plugin will be appreciated.此外,如果有任何比较 maven 和 gradle 插件的真实示例,我们将不胜感激。 I have already done stuffs like gradle init and so I need something new.我已经完成了 gradle init 之类的工作,所以我需要一些新的东西。 Here is my code:这是我的代码:

      <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <linkXRef>false</linkXRef>
                    <rulesets>
                        <ruleset>/config/setting/setting.xml</ruleset>
                    </rulesets>
                </configuration>
            </plugin>

<plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.5</version>
            <configuration>
                <destFile>${sonar.jacoco.reportPath}</destFile>
                <append>true</append>
            </configuration>
            <executions>
                <execution>
                    <id>report-sonar</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>report-sonar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

2 plugins I am struggling with.我正在努力使用的 2 个插件。 If you could show me the migrations of this two, I think i will manage to do the others.如果你能告诉我这两个的迁移,我想我会设法做其他的。

For both of your plugins there is a gradle plugin,too.对于您的两个插件,也有一个 gradle 插件。

The docs look pretty promising.这些文档看起来很有前途。

https://docs.gradle.org/current/userguide/jacoco_plugin.htmlhttps://docs.gradle.org/current/userguide/jacoco_plugin.html

https://docs.gradle.org/current/userguide/pmd_plugin.html https://docs.gradle.org/current/userguide/pmd_plugin.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM