3

maven-dependency-plugin のツリーとビルドクラスパスの間で出力の順序が異なる理由を誰か説明できますか?

私は走っています

mvn -pl releases org.apache.maven.plugins:maven-dependency-plugin:2.6:tree -Dtokens=whitespace -outputFile=tree.txt -DexcludeTransitive=true

コマンドラインで出力を生成します。tree からの出力には pom ファイルで定義された順序が反映されますが、build-classpath からの出力には反映されません。

ツリーからの出力http://pastebin.com/J2Q6iTK6

build-classpath http://pastebin.com/k2SdrHP7からの出力

どんな洞察も大歓迎です。

Maven構成

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.6</version>
            <executions>
                <execution>
                    <id>generate-classpath-windows</id>
                    <phase>generate-resources</phase>
                    <goals>
                        <goal>build-classpath</goal>
                    </goals>
                    <configuration>
                        <pathSeparator>,</pathSeparator>
                        <prefix>..\jars</prefix>
                        <fileSeparator>\</fileSeparator>
                        <outputFile>${project.build.directory}/deployment/bin/classpath.windows</outputFile>
                    </configuration>
                </execution>
                <execution>
                    <id>generate-classpath-unix</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>build-classpath</goal>
                    </goals>
                    <configuration>
                        <pathSeparator>:</pathSeparator>
                        <prefix>../jars</prefix>
                        <fileSeparator>/</fileSeparator>
                        <outputFile>${project.build.directory}/deployment/bin/classpath.unix</outputFile>
                    </configuration>
                </execution>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/deployment/jars</outputDirectory>
                    </configuration>
                </execution>
            </executions>
            <configuration>
                <overWriteReleases>false</overWriteReleases>
                <overWriteSnapshots>true</overWriteSnapshots>
                <overWriteIfNewer>true</overWriteIfNewer>
                <excludeTransitive>true</excludeTransitive>
                <includeScope>runtime</includeScope>
                <regenerateFile>true</regenerateFile>
            </configuration>
        </plugin>

情報

Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000)
Maven home: C:\apps\apache-maven-3.0.4
Java version: 1.6.0_37, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_37\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
4

1 に答える 1

1

クラスパスは線形表現であり、ツリーはネストされています。Maven は、ルート レベルの依存関係が最も近いため、クラスパスで最初にルート レベルの依存関係を保持しようとする必要があるため、最初に解決する必要があります。

あなたの出力からは、これは奇妙に見えますが、通常のロジックの再クラスパス構築として期待するものは見られません。

さらに、依存関係プラグインの 2.6 リリースまで、Maven 3.x ではdependency:tree出力が正しくありませんでした。build-classpath同じ根本原因からのバグがあるのだろうか。この質問をusers@maven.apache.orgにpingして、誰か(修正したHervé dependency:tree)が答えを知っているかどうかを確認します...

于 2013-01-15T15:09:53.573 に答える