Atlassian-plugin:未知的包装类型

时间:2016-07-13 21:18:55

标签: eclipse maven bitbucket-server atlassian-plugin-sdk

我想开发Stash插件,但无法开始使用。我们的pom.xml中有一个错误。

Project build error: Unknown packaging: atlassian-plugin
Project build error: Unresolveable build extension:
Plugin com.atlassian.maven.plugins:maven-stash-plugin:6.0.0
    or one of its dependencies could not be resolved:
Could not find artifact com.sun:tools:jar:1.7.0
    at specified path C:\Program Files (x86)\Java\jre1.7.0_75/../lib/tools.jar

我开始知道maven无法将atlasian-plugin识别为包类型。有没有办法创建我们自己的包装类型?解决此问题的最佳方法是什么?

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.xxxxx</groupId>
    <artifactId>fkjghff</artifactId>
    <version>856</version>

    <organization>
        <name>CATE Developer Experience</name>
        <url>www.xxxxxx</url>
    </organization>

    <name>name of the project</name>
    <description>description of the project</description>
    <packaging>atlassian-plugin</packaging>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.atlassian.stash</groupId>
                <artifactId>stash-parent</artifactId>
                <version>${stash.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- CCD dependencies START -->
            <dependency>
                <groupId>com.atlassian.activeobjects</groupId>
                <artifactId>activeobjects-plugin</artifactId>
                <version>${ao.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- SAL, the Active Objects plugin uses SAL's API for transactions -->
            <dependency>
                <groupId>com.atlassian.sal</groupId>
                <artifactId>sal-api</artifactId>
                <version>2.4.1</version>
                <scope>provided</scope>
            </dependency>

            <!-- Google Collections, useful utilities for manipulating collections -->
            <dependency>
                <groupId>com.google.collections</groupId>
                <artifactId>google-collections</artifactId>
                <version>1.0</version>
                <scope>provided</scope>
            </dependency>

            <!-- CCD dependencies END -->
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.activeobjects</groupId>
            <artifactId>activeobjects-plugin</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-spi</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-page-objects</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.soy</groupId>
            <artifactId>soy-template-renderer-api</artifactId>
            <scope>provided</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>
        <dependency>
            <groupId>com.atlassian.stash</groupId>
            <artifactId>stash-ssh</artifactId>
            <scope>provided</scope>
            <version>${stash.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-stash-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <products>
                        <product>
                            <id>stash</id>
                            <instanceId>stash</instanceId>
                            <version>${stash.version}</version>
                            <dataVersion>${stash.data.version}</dataVersion>
                        </product>
                    </products>
                    <systemPropertyVariables>
                        <johnson.spring.lifecycle.synchronousStartup>true</johnson.spring.lifecycle.synchronousStartup>
                    </systemPropertyVariables>
                    <pluginArtifacts>
                        <pluginArtifact>
                            <groupId>com.atlassian.activeobjects</groupId>
                            <artifactId>activeobjects-plugin</artifactId>
                            <version>${ao.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.activeobjects</groupId>
                            <artifactId>activeobjects-refapp-spi</artifactId>
                            <version>${ao.version}</version>
                        </pluginArtifact>
                    </pluginArtifacts>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.xml</include>
                     </includes>
                     <filtering>true</filtering>
                     </resource>
                     <resource>
                     <directory>src/main/resources</directory>
                     <includes>
                     <include>**/*.soy</include>
                </includes>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.js</include>
                     </includes>
                     <filtering>false</filtering>
                     </resource>
                     <resource>
                     <directory>src/main/resources</directory>
                     <includes>
                     <include>**/*.properties</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>

    <properties>
        <stash.version>3.9.2</stash.version>
        <stash.data.version>3.9.2</stash.data.version>
        <amps.version>6.0.0</amps.version>
        <jdk.version>1.8</jdk.version>
        <ao.version>0.19.7</ao.version>
        <plugin.testrunner.version>1.2.0</plugin.testrunner.version>
    </properties>
</project>

3 个答案:

答案 0 :(得分:3)

您是否根据此文档配置了eclipse?

https://developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and-build-a-project/set-up-the-eclipse-ide-for-linux

(还有其他操作系统的文档)

应用程序设置 - &gt; Maven - &gt;安装 - &gt;添加 - &gt; /Applications/Atlassian/atlassian-plugin-sdk-5.1.10/apache-maven-3.2.1(或无论您身在何处)

应用程序设置 - &gt; Maven - &gt;用户设置 - &gt;全局设置 - &gt; /Applications/Atlassian/atlassian-plugin-sdk-5.1.10/apache-maven-3.2.1/conf/settings.xml(或无论你身在何处)

答案 1 :(得分:0)

当我读到“找不到工件com.sun:tools:jar:1.7.0”时,我的第一个猜测是你可能想要切换到jdk而不是jre。在我写这篇评论的时候,Atlassian正在要求1.8.x的jdk版本。

答案 2 :(得分:0)

您必须在pom.xml中添加以下内容:

<project>
...
    <pluginRepositories>
        <pluginRepository>
            <id>atlassian-public</id>
            <url>https://m2proxy.atlassian.com/repository/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
...
</project>