0

JIRA 6.0.7ソースからビルドしようとしています

https://confluence.atlassian.com/jira064/building-jira-from-source-720411927.html

ビルドに問題がJDK-8あったため、使用する必要がありましたJDK-7。クラス ファイルのバージョンが原因で、1 つのアーティファクトが最新のプラグイン バージョンをダウンロードし (明示的なバージョンは pom.xml で定義されています)、失敗します。

の出力は次のmvn -X packageとおりです。

[INFO] Scanning for projects...
[DEBUG] com.atlassian.maven.plugins:maven-jira-plugin:jar:4.1.5:
[DEBUG]    com.atlassian.maven.archetypes:jira-plugin-archetype:jar:4.1.5:runtime
[DEBUG]    com.atlassian.maven.plugins:maven-amps-plugin:jar:4.1.5:compile
...
[DEBUG]   Included: com.atlassian.maven.plugins:maven-amps-plugin:jar:4.1.5
...
[DEBUG] Resolving plugin version for com.atlassian.maven.plugins:maven-amps-plugin
[DEBUG] Could not find metadata com.atlassian.maven.plugins:maven-amps-plugin/maven-metadata.xml in local (C:\m2repo)
[DEBUG] Skipped remote update check for com.atlassian.maven.plugins:maven-amps-plugin/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Skipped remote update check for com.atlassian.maven.plugins:maven-amps-plugin/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Resolved plugin version for com.atlassian.maven.plugins:maven-amps-plugin to 6.2.6 from repository atlassian-proxy (https://m2proxy.atlassian.com/repository/public, releases+snapshots)
...
Caused by: java.lang.UnsupportedClassVersionError: com/atlassian/maven/plugins/amps/osgi/ValidateTestManifestMojo : Unsupported major.minor version 52.0

問題を再現するための簡略化された 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>bar</groupId>
    <artifactId>foo</artifactId>
    <version>1.1.7</version>
    <packaging>atlassian-plugin</packaging>
    <name>foo</name>
    <description>foo</description>


<dependencies>
</dependencies>

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

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <version>4.1.5</version>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>

</project>

ノート

maven-amps-plugin-4.1.5.jarJava 6用に構築されています:

C:\>javap -v -classpath maven-amps-plugin-4.1.5.jar com.atlassian.maven.plugins.amps.osgi.ValidateTestManifestMojo | find "major version"
  major version: 50

注2

私はとても必死です、私は今mavenコードをデバッグしています。https://maven.apache.org/ref/3.3.1/xref/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.html#L90

フォールバックする前に をresolveFromRepository()試みresolveFromProject()ますが、失敗しますrequest.pom == null。なんで?

project.getBuildPlugins() は (多くの中で)maven-amps-pluginを返しますversion == null。なんで?

project.getBuildPlugins().get(0)
    artifactId  "maven-jira-plugin" (id=489)    
    version "4.1.5" (id=498)    

project.getBuildPlugins().get(5)
    artifactId  "maven-amps-plugin" (id=402)    
    version null    

最初に、Pluginオブジェクトは解析中に正しいバージョンで作成されcom/atlassian/amps/standalone/4.1.5/standalone-4.1.5.pomますが、次に別のインスタンスが で作成されDefaultLifecyclePluginAnalyzer.parseLifecyclePhaseDefinitions()ます。が原因だと思われます<packaging>atlassian-plugin</packaging>

4

1 に答える 1

0

の依存関係であるmaven-amps-plugin4.1.5 は、maven-jira-pluginJDK 8 を使用して構築されているようです。取得できるバージョン、できれば以前のバージョンを試してみました。不思議なことに、Maven Central は 2015 年から 5.0.18 を持っているので、私はそれを熟考し、最終的に Oracle ドライバーに問題が発生しました。ローカル リポジトリにある可能性があり、このスニペットが役に立ちます。したがって、それが問題の適切な解決策である可能性が低い場合でも、念のため。

        <plugin>
            <groupId>com.atlassian.maven.plugins</groupId>
            <artifactId>maven-jira-plugin</artifactId>
            <version>4.1.5</version>
            <extensions>true</extensions>
            <dependencies>
                <dependency>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>maven-amps-plugin</artifactId>
                    <version>5.0.18</version>
                </dependency>
            </dependencies>
        </plugin>
于 2016-07-28T17:15:06.370 に答える