无法启动jira - 无法执行mojo异常

时间:2015-11-24 17:19:44

标签: maven maven-3 jira pom.xml

我在我的系统和Atlassian SDK 6.1.2中运行JIRA 7.0.2。

OS-Windows 7

我有自己的插件,当我尝试通过atlas-debug运行jira时,我得到了这个异常。

--- maven-jira-plugin:6.1.2:generate-manifest (default-generate-manifest) @ jira-menu-items ---
Generating a manifest for this plugin
using maven-bundle-plugin v2.5.3
Manifest com.atlassian.plugins.tutorial:jira-menu-items:atlassian-plugin:1.1 : The default package '.' is not permitted by the Import-Package syntax. 
 This can be caused by compile errors in Eclipse because Eclipse creates 
valid class files regardless of compile errors.
The following package(s) import from the default package null
Error(s) found in manifest configuration
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 2:32.854s
Finished at: Tue Nov 24 22:24:04 IST 2015
Final Memory: 66M/682M
------------------------------------------------------------------------
Failed to execute goal com.atlassian.maven.plugins:maven-jira-plugin:6.1.2:generate-manifest (default-generate-manifest) on project jira-menu-items: Unable to execute mojo: Error(s) found in manifest configuration -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

的pom.xml

<?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.plugins.tutorial</groupId>
    <artifactId>jira-menu-items</artifactId>
    <version>1.1</version>

    <organization>
        <name>Milind Company</name>
        <url>http://www.milind.com/</url>
    </organization>

    <name>jira-menu-items</name>
    <description>This is the com.atlassian.plugins.tutorial:jira-menu-items 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>
<dependency>
      <groupId>com.oracle</groupId>
      <artifactId>ojdbc6</artifactId>
      <version>11.2.0.2.0</version>
      <scope>compile</scope>

    </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <version>${atlassian.spring.scanner.version}</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-runtime</artifactId>
            <version>${atlassian.spring.scanner.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
    <groupId>com.atlassian.maven.plugins</groupId>
    <artifactId>maven-amps-dispatcher-plugin</artifactId>
    <version>5.0.18</version>
</dependency>

        <dependency>
    <groupId>com.atlassian.plugin</groupId>
    <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
    <version>1.2.6</version>
</dependency>

        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
            <scope>provided</scope>
        </dependency>

        <!-- WIRED TEST RUNNER DEPENDENCIES -->

        <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>
        -->
    </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>
                    <enableQuickReload>true</enableQuickReload>
                    <enableFastdev>false</enableFastdev>
                    <instructions>
                        <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
                        <Export-Package>net.gisnas.jira.mailqueue.api,</Export-Package>
                        <Import-Package>org.springframework.osgi.*;resolution:="optional",
                            org.eclipse.gemini.blueprint.*;resolution:="optional", *</Import-Package>
                        <Spring-Context>*</Spring-Context>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.atlassian.plugin</groupId>
                <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
                <version>1.2.6</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>atlassian-spring-scanner</goal>
                        </goals>
                        <phase>process-classes</phase>
                    </execution>
                </executions>
                <configuration>
                    <scannedDependencies>
                        <dependency>
                            <groupId>com.atlassian.plugin</groupId>
                            <artifactId>atlassian-spring-scanner-external-jar</artifactId>
                        </dependency>
                    </scannedDependencies>
                    <verbose>false</verbose>
                </configuration>
            </plugin>
        <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.1</version>
                        <configuration>
                            <source>1.7</source>
                            <target>1.7</target>
                        </configuration>
                                </plugin>


        </plugins>
    </build>

    <properties>
        <jira.version>7.0.2</jira.version>
        <amps.version>6.1.2</amps.version>
        <plugin.testrunner.version>1.2.3</plugin.testrunner.version>
        <atlassian.spring.scanner.version>1.2.6</atlassian.spring.scanner.version>
        <!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
        <!-- TestKit version 6.x for JIRA 6.x -->
        <testkit.version>6.3.11</testkit.version>
    </properties>

</project>

将Settings.xml

<settings>
    <localRepository>C:\Users\Milind\.m2\repository</localRepository>
    <profiles>
        <profile>
            <id>atlassian-repositories</id>
            <repositories>
                <repository>
                    <id>atlassian-proxy</id>
                    <name>Atlassian Maven 2 Proxy</name>
                    <url>https://m2proxy.atlassian.com/repository/public</url>
                </repository>
                <repository>
                    <id>atlassian-contrib</id>
                    <name>Atlassian Contrib Repository</name>
                    <url>https://m2proxy.atlassian.com/contrib</url>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>atlassian-proxy</id>
                    <name>Atlassian Maven 2 Proxy</name>
                    <url>https://m2proxy.atlassian.com/repository/public</url>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>atlassian-repositories</activeProfile>
    </activeProfiles>

</settings>

1 个答案:

答案 0 :(得分:1)

  1. 尝试清理插件目录中的目标目录,或者只使用插件目录中的命令atlas-clean并运行插件。
  2. 如果您在运行插件之前在pom.xml中进行了一些更改,则应首先执行此命令atlas-mvn eclipse:eclipse。每次在pom中进行更改时,都应该执行此命令。
  3. 请检查一下您的JDK版本是否为8,因为JIRA 7.x只适用于JDK 8.
  4. 您已为相关的放大器设置了不兼容的版本。使用6.1.2而不是5.x

                com.atlassian.maven.plugins             行家放大器,分配器,插件             5.0.18

  5. 如果您在从命令运行JIRA后尝试在Eclipse中调试代码,则应指定用于附加调试器的端口号。您的命令将如下atlas-debug --jvm -debug -port 5005

    希望这可以帮助您解决问题。