简体   繁体   English

将使用插件的Maven项目转换为Gradle项目

[英]Converting maven project that uses plugins to a gradle project

I'm new with Gradle and confused to change maven code to gradle, I get code from ApacheKarafCookbook and want to use gradle as build tool. 我是Gradle的新手,很困惑将Maven代码更改为gradle,我从ApacheKarafCookbook获得了代码,并希望将gradle用作构建工具。 I tried use gradle init and its not working. 我尝试使用gradle init ,它不起作用。

<build>
    <plugins>
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.7.0.201403182114</version>
            <executions>
                <execution>
                    <id>prepare-agent-integration</id>
                    <goals>
                        <goal>prepare-agent-integration</goal>
                    </goals>
                    <phase>pre-integration-test</phase>
                    <configuration>
                        <propertyName>jcoverage.command</propertyName>
                        <includes>
                            <include>com.packt.*</include>
                        </includes>
                        <append>true</append>
                    </configuration>
                </execution>
                <execution>
                    <id>report</id>
                    <goals>
                        <goal>report-integration</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

How do I change to gradle? 如何更改为gradle?

gradle init will not do auto conversion of maven plugins, phases and targets. gradle init不会自动转换Maven插件,阶段和目标。 You'll have to do that bit by hand. 您必须手动执行该操作。 Here's some documentation on how to setup and use the gradle jacoco plugin . 这是一些有关如何设置和使用gradle jacoco插件的文档。

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

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