Maven,插件和JIRA [英] Maven, plugins, and JIRA

查看:160
本文介绍了Maven,插件和JIRA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在浏览JIRA的hello world示例( https://开发人员。开启/开始)。

I've been running through the hello world example from JIRA(https://developer.atlassian.com/display/DOCS/Getting+Started).

Eclipse(开普勒)给了我一大笔错误的列表, c> pom 为我的项目。特别是第一个插件标签。所有这些都是一些变体

Eclipse (Kepler) gives me a large list of errors in the pom for my project. Specifically on the first plugin tag. All of them are some variation of


生命周期配置未涵盖的插件执行:com.atlassian.maven.plugins:maven-jira-
插件:4.2.10:filter-test-plugin-descriptor(执行:default-filter-test-plugin-descriptor,phase:process-test-
资源)

Plugin execution not covered by lifecycle configuration: com.atlassian.maven.plugins:maven-jira- plugin:4.2.10:filter-test-plugin-descriptor (execution: default-filter-test-plugin-descriptor, phase: process-test- resources)

在第二个冒号后面加上说明。我认为这些是目标。

with descriptions after the second colon. I think these are the goals.

我遇到过这个,但对于所有这些都是全新的人来说,这并不是很大的帮助。

I've come across this but it wasn't much help to someone who was completely new to all this.

这是由Atlassian生成的 pom

Here is the pom that was generated by Atlassian:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.atlassian.tutorial</groupId>
    <artifactId>helloworld</artifactId>
    <version>1.0-SNAPSHOT</version>

    <organization>
        <name>HelloGoodby Inc.</name>
        <url>http://www.helloworldgoodbye.com</url>
    </organization>

    <name>helloworld</name>
    <description>This is the com.atlassian.tutorial:helloworld plugin for Atlassian JIRA.</description>
    <packaging>atlassian-plugin</packaging>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Add dependency on jira-core if you want access to JIRA implementation 
            classes as well as the sanctioned API. -->
        <!-- This is not normally recommended, but may be required eg when migrating 
            a plugin originally developed against JIRA 4.x -->
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>

        <!-- WIRED TEST RUNNER DEPENDENCIES -->
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-testrunner</artifactId>
            <version>${plugin.testrunner.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.2.2-atlassian-1</version>
        </dependency>

        <!-- Uncomment to use TestKit in your project. Details at https://bitbucket.org/atlassian/jira-testkit -->
        <!-- You can read more about TestKit at https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Smarter+integration+testing+with+TestKit -->
        <!-- <dependency>
            <groupId>com.atlassian.jira.tests</groupId>
            <artifactId>jira-testkit-client</artifactId> 
            <version>${testkit.version}</version>
            <scope>test</scope>
        </dependency> -->
        <dependency>
            <groupId>com.atlassian.maven.plugins</groupId>
            <artifactId>maven-amps-plugin</artifactId>
            <version>4.2.10</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.version}</productDataVersion>
                    <!-- Uncomment to install TestKit backdoor in JIRA. -->
                    <!-- <pluginArtifacts> <pluginArtifact> <groupId>com.atlassian.jira.tests</groupId> 
                        <artifactId>jira-testkit-plugin</artifactId> <version>${testkit.version}</version> 
                        </pluginArtifact> </pluginArtifacts> -->
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <properties>
        <jira.version>6.1.3</jira.version>
        <amps.version>4.2.10</amps.version>
        <plugin.testrunner.version>1.1.2</plugin.testrunner.version>
        <!-- TestKit version 5.x for JIRA 5.x, 6.x for JIRA 6.x -->
        <testkit.version>5.2.26</testkit.version>
    </properties>
</project>


推荐答案

然而,这个将完全解决你的问题。

And yet, "this" is exactly going to fix your problem for you.

虽然Maven只是直截了当地执行任何插件配置, Eclipse中的Maven Integration(m2e)更不愿意做所以。而不是在命令行上执行的一切都应该在Eclipse中执行。现在,一些常见的插件会自动处理,但是当它遇到Atlassian插件时,它似乎不知道该怎么做,并希望你的帮助。

While Maven just bluntly executes whatever plugins are configured, the Maven Integration (m2e) in Eclipse is a bit more reluctant in doing so. Not everything that makes sense for execution on the command-line should also be executed while within Eclipse. Now, some common plugins it will automatically take care of, but when it encounters the Atlassian plugins it seemingly does not know what to do, and wants your help with that.

根据所讨论的插件,您可以:

Depending on the plugin in question, you can either:


  1. 为该特定插件安装一个m2e连接器(将知道该怎么做)

  2. 配置您的POM文件中要执行的操作( pom.xml

  3. 配置在本地Eclipse中执行

这些以(我)的优先顺序给出。在任何情况下,都有很大的意义,因为每个开发人员导入您的POM文件都会很好,想一想。 POM文件中的配置可以告诉m2e到 ignore 执行插件执行,在后一种情况下是否运行增量版本( runOnIncremental )。

These are given in (my) order of preference. In any case 2. makes a lot of sense, because each developer who imports your POM file will be good to go, think about that. The configuration in the POM file can either tell m2e to ignore or execute the plugin execution, and in the latter case whether to run on incremental builds (runOnIncremental).

链接给出了在$ $ c下的插件配置中配置为 lifecycleMappingMetadata 的配置示例$ c>您的POM的pluginManagement 。好消息是,Eclipse可以帮助您使用上述三种解决方案,快速解决您所看到的错误。

"The link" gives examples of this configuration, which is configured as lifecycleMappingMetadata in a plugin configuration under pluginManagement of your POM. The good news is that Eclipse can help you with the three solutions above using a quick fix on the error that you're seeing.

这篇关于Maven,插件和JIRA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆