Maven,插件和JIRA

时间:2013-11-25 23:35:10

标签: eclipse maven jira

我一直在试用JIRA(https://developer.atlassian.com/display/DOCS/Getting+Started)的hello world示例。

Eclipse(Kepler)为我的项目pom提供了大量错误列表。特别是在第一个插件标签上。所有这些都是

的一些变种
  

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

第二个冒号后的描述。我认为这些是目标。

我遇到了this,但对那些对这一切完全陌生的人来说并没什么帮助。

以下是Atlassian生成的pom

<?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>

1 个答案:

答案 0 :(得分:1)

然而,“this”正好能解决你的问题。

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

根据相关插件的不同,您可以:

  1. 为该特定插件安装m2e连接器(将知道该怎么做)
  2. 配置您的POM文件(pom.xml
  3. 中的操作
  4. 配置在本地Eclipse中执行的操作
  5. 这些是以(我的)优先顺序给出的。在任何情况下2.很有意义,因为每个导入POM文件的开发人员都会很好,想一想。 POM文件中的配置可以告诉m2e到ignoreexecute插件执行,在后一种情况下是否在增量构建(runOnIncremental)上运行。

    The link”提供了此配置的示例,该配置在POM的lifecycleMappingMetadata下的插件配置中配置为pluginManagement。好消息是Eclipse可以通过快速修复您所看到的错误来帮助您解决上述三种解决方案。