【问题标题】:Maven, plugins, and JIRAMaven、插件和 JIRA
【发布时间】:2013-11-25 23:35:10
【问题描述】:

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

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

的一些变体

生命周期配置未涵盖插件执行:com.atlassian.maven.plugins:maven-jira- plugin: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>

【问题讨论】:

    标签: eclipse maven jira


    【解决方案1】:

    然而,“this”确实会为您解决问题。

    虽然 Maven 只是直接执行配置的任何插件,但 Maven Integration (m2e) in Eclipse 不太愿意这样做。并非所有对命令行执行有意义的东西都应该在 Eclipse 中执行。现在,它会自动处理一些常见的插件,但是当它遇到 Atlassian 插件时,它似乎不知道该怎么做,并且需要您的帮助。

    根据相关插件,您可以:

    1. 为该特定插件安装 m2e 连接器(它会知道该怎么做)
    2. 配置在您的 POM 文件中执行的操作 (pom.xml)
    3. 配置在本地 Eclipse 中执行的操作

    这些是按(我的)偏好顺序给出的。无论如何 2. 很有意义,因为每个导入您的 POM 文件的开发人员都会很好,请考虑一下。 POM 文件中的配置可以将 m2e 告知 ignore 或 execute 插件执行,以及在后一种情况下是否在增量构建上运行 (runOnIncremental)。

    “The link”给出了这个配置的例子,在你的 POM 的pluginManagement 下的插件配置中配置为lifecycleMappingMetadata。好消息是 Eclipse 可以通过快速修复您看到的错误来帮助您解决上述三个解决方案。

    【讨论】:

    • 问题是我不确定要在“某个目标”之类的字段中添加什么。我假设组 id 和工件 id 与配置标签之前的标签中的相同。但是,我没有目标可以复制到下面。我对 maven 不是很熟悉,这个 pom 文件是由 atlassian 软件自动生成的。 Eclipse 提供了一个快速修复来将插件配置设置为忽略,但我很犹豫,因为我担心它不会加载插件。
    • 所以,使用快速修复作为起点。 lifecycleMappingMetadata 的配置并不完全是微不足道的,所以不要尝试自己编造!
    猜你喜欢
    • 1970-01-01
    • 2018-04-07
    • 1970-01-01
    • 1970-01-01
    • 2015-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-11
    相关资源
    最近更新 更多