これはほとんど初心者の Maven の質問です。
SwingX が Kenai に移行されてから、多くのリンクが壊れているという警告が Web サイト全体に表示されています.
- https://java.net/projects/swingx/downloads/directory/releasesに行きました
- 「SwingX 1.6.4 All - Sources」をクリックしました (私にとっては直観的ではない、ヒットまたはミスの選択ですが、おそらく他の人が理解している命名規則でしょうか?)
- これにより、swingx-all-1.6.4-sources.jar がダウンロードされます (なぜ zip ではなく jar なのですか?)
ただし、このソース jar には POM.XML が含まれていません。
そのため、同じリンクから swingx-all-1.6.4.jar をダウンロードし、名前を .zip に変更して膨らませました。META-INF\maven\org.swinglabs.swingx\swingx-all\POM.XML が含まれています。
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>swingx-project</artifactId>
<groupId>org.swinglabs.swingx</groupId>
<version>1.6.4</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>swingx-all</artifactId>
<packaging>jar</packaging>
<name>SwingX Complete</name>
<description>A Maven project to aggregate all modules into a single artifact.</description>
<properties>
<project.generatedDependencies>${project.generatedSourcesDirectoy}/dependencies</project.generatedDependencies>
</properties>
<!-- make the dependent swingx modules optional, since we're aggregating -->
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>swingx-graphics</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>swingx-core</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>swingx-mavensupport</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
<profiles>
<profile>
<id>jvnet-release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>src-dependencies</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<classifier>sources</classifier>
<includeGroupIds>${project.groupId}</includeGroupIds>
<excludeArtifactIds>swingx-mavensupport</excludeArtifactIds>
<failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
<outputDirectory>${project.generatedDependencies}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>add-dependencies-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.generatedDependencies}</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-dependencies-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${project.generatedDependencies}</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.generatedAnnotations}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
POM.XML が配置されている上記のディレクトリに変更して mvn install を実行すると、確かに多くのものが構築されます..しかし、次のようにも言います:
[INFO] 存在しない resourceDirectory F:\swingx\swingx-all-1.6.4\META-INF\m Maven\org.swinglabs.swingx\swingx-all\src\main\resources をスキップ
これは、src ディレクトリが存在しないためです。問題の .jar ファイルはバイナリのみと言われているため、これは理にかなっていますが、一部の Maven ターゲットがソースまたは何かをダウンロードすることを望んでいました...バイナリのみの場合、なぜビルドする必要があるのでしょうか? 混乱している。
その時点で、src ディレクトリを最初の zip ファイルから 2 番目のファイルにコピーするか、pom.xml を 2 番目のファイルから最初のファイルにコピーすることができます。より簡単な方法になります。
ところで、同じ Web ページに 3 番目のファイル、swingx-mavensupport-1.6.4.jar があります。
それで私はそれをダウンロードし、それを.zipに名前を変更し、膨らませて、このファイルを見つけました: META-INF\maven\org.swinglabs.swingx\swingx-mavensupport\POM.XML:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>swingx-project</artifactId>
<groupId>org.swinglabs.swingx</groupId>
<version>1.6.4</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>swingx-mavensupport</artifactId>
<name>SwingX Maven Support</name>
</project>
そのディレクトリに移動し、 mvn.install を実行しました
ただし、それは大量のファイルが不足していることに不満を持っていました.
私はそれをすべて間違っているに違いありません。正しい方法は何ですか?