当前位置: 首页 > 知识库问答 >
问题:

Atlassian bitbucket插件maven编译错误

晏鸿畅
2023-03-14

我有与BitBucket版本5.2.2一起工作的插件,我想更新它以支持BitBucket版本6.8.0。如下所示更新我的pom.xml后,当我尝试运行mvn compile时,我遇到依赖项错误:

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>*******custom-plugin-groupId*******</groupId>
        <artifactId>*******custom-plugin-artifactId*******</artifactId>
        <version>2.0.0</version>

        <parent>
            <groupId>*******custom-parent-plugin-groupId*******</groupId>
            <artifactId>parent</artifactId>
            <version>0.7</version>
        </parent>

        <name>*******Plugin Name*******</name>
        <description>*******Plugin Description*******</description>
        <packaging>atlassian-plugin</packaging>

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

        <dependencies>
            <dependency>
                <groupId>com.atlassian.sal</groupId>
                <artifactId>sal-api</artifactId>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax.xml.bind</groupId>
                <artifactId>jaxb-api</artifactId>
                <version>2.1</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.bitbucket.server</groupId>
                <artifactId>bitbucket-api</artifactId>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.bitbucket.server</groupId>
                <artifactId>bitbucket-spi</artifactId>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.bitbucket.server</groupId>
                <artifactId>bitbucket-page-objects</artifactId>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>4.5.1</version>
                <classifier>tests</classifier>
                <scope>test</scope>
            </dependency>

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

            <dependency>
                <groupId>com.atlassian.plugin</groupId>
                <artifactId>atlassian-spring-scanner-runtime</artifactId>
                <scope>runtime</scope>
            </dependency>

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

            <dependency>
                <groupId>com.atlassian.plugins</groupId>
                <artifactId>atlassian-plugins-osgi-testrunner</artifactId>
                <version>${plugin.testrunner.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <version>1.5.7.RELEASE</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>2.12.0</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>
            </dependency>
            <dependency>
                <groupId>com.atlassian.templaterenderer</groupId>
                <artifactId>atlassian-template-renderer-api</artifactId>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>4.2.5.RELEASE</version>
            </dependency>
        </dependencies>

        <build>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>bitbucket-maven-plugin</artifactId>
                    <version>${amps.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <extractDependencies>false</extractDependencies>
                        <products>
                            <product>
                                <id>bitbucket</id>
                                <instanceId>bitbucket</instanceId>
                                <version>${bitbucket.version}</version>
                                <dataVersion>${bitbucket.data.version}</dataVersion>
                            </product>
                        </products>
                        <instructions>
                            <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>

                            <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>${atlassian.spring.scanner.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>atlassian-spring-scanner</goal>
                            </goals>
                            <phase>process-classes</phase>
                        </execution>
                    </executions>
                    <configuration>
                        <includeExclude>-com.atlassian.plugin.spring.scanner.annotation.*</includeExclude>

                        <scannedDependencies>
                            <dependency>
                                <groupId>com.atlassian.plugin</groupId>
                                <artifactId>atlassian-spring-scanner-external-jar</artifactId>
                            </dependency>
                        </scannedDependencies>
                        <verbose>false</verbose>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.6.1</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
            </plugins>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.eclipse.m2e</groupId>
                        <artifactId>lifecycle-mapping</artifactId>
                        <version>1.0.0</version>
                        <configuration>
                            <lifecycleMappingMetadata>
                                <pluginExecutions>
                                    <pluginExecution>
                                        <pluginExecutionFilter>
                                            <groupId>
                                                com.atlassian.maven.plugins
                                            </groupId>
                                            <artifactId>
                                                bitbucket-maven-plugin
                                            </artifactId>
                                            <versionRange>
                                                [6.3.21,)
                                            </versionRange>
                                            <goals>
                                                <goal>
                                                    generate-rest-docs
                                                </goal>
                                            </goals>
                                        </pluginExecutionFilter>
                                        <action>
                                            <ignore></ignore>
                                        </action>
                                    </pluginExecution>
                                </pluginExecutions>
                            </lifecycleMappingMetadata>
                        </configuration>
                    </plugin>
                </plugins>
            </pluginManagement>
        </build>
       <properties>
            <bitbucket.version>6.8.0</bitbucket.version>
            <bitbucket.data.version>6.8.0</bitbucket.data.version>
            <amps.version>6.2.11</amps.version>
            <plugin.testrunner.version>1.2.3</plugin.testrunner.version>
            <atlassian.spring.scanner.version>1.2.13 
            </atlassian.spring.scanner.version>
            <atlassian.plugin.key>${project.groupId}.${project.artifactId} 
            </atlassian.plugin.key>
        </properties>
    </project>

编译时出错:

[INFO] --- bitbucket-maven-plugin:6.2.11:compress-resources (default-compress-resources) @ custom-plugin ---
    [WARNING] Error injecting: com.atlassian.maven.plugins.updater.MarketplaceSdkResource
java.lang.NoClassDefFoundError: Lorg/codehaus/jackson/map/ObjectMapper;
    at java.lang.Class.getDeclaredFields0 (Native Method)
    at java.lang.Class.privateGetDeclaredFields (Class.java:2583)
    at java.lang.Class.getDeclaredFields (Class.java:1916)
Caused by: java.lang.ClassNotFoundException: org.codehaus.jackson.map.ObjectMapper

我不确定所提到的bitbucket版本的amps和bitbucket-maven-plugin的对应版本,这可能是错误的原因之一。

共有1个答案

都建树
2023-03-14

尝试以下版本设置,我没有尝试过,但我遇到了一个在Bitbucket6.x上工作的开源存储库

<properties>
    <bitbucket.version>6.0.0</bitbucket.version>
    <bitbucket.data.version>${bitbucket.version}</bitbucket.data.version>
    <plugins.rest.version>3.0.8</plugins.rest.version>
    <plugins.webresource.version>3.4.3</plugins.webresource.version>
    <amps.version>8.0.0</amps.version>
    <plugin.testrunner.version>1.1.1</plugin.testrunner.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

回购

 类似资料:
  • 我有一个maven项目,它是从git回购复制到我的eclipse上的。它是基于Java8构建的。我要做的第一件事就是做一个 但我收到以下失败信息: 以及汇编设置: 无论我构建项目多少次,我都会得到相同的错误。即使在清理项目并从eclipse中刷新它之后也没有帮助。请导游。 更新: 在添加属性以设置maven编译器插件之后 , 我得到以下错误: 下面是给出MainUITabbed类编译错误的代码片段

  • 问题内容: 当我在Netbeans中构建并运行程序时,它可以正常工作。但是当我尝试“ mvn compile”时,使用相同的pom.xml文件会出现以下错误: 我的Java版本不是1.3,这里是“ mvn -version”的结果 这是第53行: 问题答案: 问题是在Maven2中默认使用和 您可以通过将其添加到pom中来解决此问题: 将其放在最顶层的父pom中是很实际的,这样您派生的pom不需要

  • 编译模块com。实例我的包裹。GWT。HelloGWT [INFO]验证新编译的单元 [INFO]在第一次过程中忽略了1个单元,其中包含编译错误 [INFO]编译时将-strict或-logLevel设置为TRACE或DEBUG以查看所有错误 [INFO]在文件:/home/ilsurih/Projects/maven hibernate/src/main/java/com/example/myP

  • 我在Eclipse中使用maven创建了一个webapp项目。当我在命令提示符下运行命令mvn包时,它会显示folowing错误。 我尝试更改jdk和JRE。但不起作用。仍然显示相同的错误

  • 生成失败,错误如下: [ERROR]未能执行目标org.apache.maven.plugins:maven-compiler-plugin:3.1:编译(默认编译)上的项目r esPonderhub:编译失败[ERROR] /X:/工作区/响应器HubWorkspace/响应器Hub/src/main/java/uk/org/响应器Hub/MemberServlet.java:[23,110]找

  • 从事maven项目。我试图使用maven进行构建,但我遇到了以下错误!我正在使用JDK 8开发eclipse。 无法执行目标org.apache.maven.plugins:maven-compiler-plugin:2.3.2:编译(默认编译) 我也尝试了上面的解决方案,但我仍然得到错误!