0

Maven 統合で Eclipse を使用しており、プロジェクトに JFXtras を含めています。Maven ビルドを実行すると、jar が正常に作成されますが、実行しようとすると、

java.lang.ClassNotFoundException: jfxtras.scene.control.ListSpinner

ここで説明されているように jfxtras を統合しました: http://mvnrepository.com/artifact/org.jfxtras/jfxtras-labs/8.0-r3

編集:

<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>
  <groupId>propgr</groupId>
  <artifactId>Project</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <dependencies>
  <dependency>
    <groupId>org.jfxtras</groupId>
    <artifactId>jfxtras-labs</artifactId>
    <version>8.0-r1</version>
</dependency>
<dependency>
    <groupId>org.jfxtras</groupId>
    <artifactId>jfxtras-controls</artifactId>
    <version>8.0-r1</version>
</dependency>
<dependency>
    <groupId>org.jfxtras</groupId>
    <artifactId>jfxtras-common</artifactId>
    <version>8.0-r1</version>
</dependency>

</dependencies>
  <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>main.Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>
</project>

アイデア/助けはありますか?

4

1 に答える 1

2

JFXtras は多数のアーティファクトで構成されています。labs、controls、common、...、それらの間にいくつかの依存関係があります。ラボの依存関係がありません。以下のポンは私のために働きます。

<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>
    <groupId>propgr</groupId>
    <artifactId>Project</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <dependencies>
        <dependency>
            <groupId>org.jfxtras</groupId>
            <artifactId>jfxtras-labs</artifactId>
            <version>8.0-r3</version>
        </dependency>
    </dependencies>
    <build>
        ...
   </build>
</project>

これはリリース用です。スナップショットを使用する場合は、Sonatype スナップショット リポジトリを pom または .m2/settings.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>
    <groupId>propgr</groupId>
    <artifactId>Project</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <dependencies>
        <dependency>
            <groupId>org.jfxtras</groupId>
            <artifactId>jfxtras-labs</artifactId>
            <version>8.0-r4-SNAPSHOT</version>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>oss-sonatype</id>
            <name>oss-sonatype</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <build>
        ...
   </build>
</project>
于 2015-06-25T05:54:11.350 に答える