2017-08-28 11 views
0

私はJAVAFX applicationに取り組んでいて、pom.xmlファイルを使用しています。依存関係は、最後のコンピュータではうまくいきましたが、別のPCにインポートしたときにエラーが発生しています。 maven plugin、私はインターネット上で検索し、そこに与えられたすべての可能な解決策に従ったが、すべて私のために働いていない。私のJavaプログラムがMavenプラグインをロードできないのはなぜですか?

質問があります。なぜ、このエラーが発生して、mavenプラグインをロードできなかったのですか?ここ

はログトレースです:

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project EmployeeManagement: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1] 

To see the full stack trace of the errors, re-run Maven with the -e switch. 
Re-run Maven using the -X switch to enable full debug logging. 

For more information about the errors and possible solutions, please read the following articles: 

、ここでは私の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/xsd/maven-4.0.0.xsd"> 
<modelVersion>4.0.0</modelVersion> 

<groupId>com.viremp</groupId> 
<artifactId>EmployeeManagement</artifactId> 
<version>1.0</version> 
<packaging>jar</packaging> 

<name>EmployeeManagement</name> 

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <mainClass>com.viremp.employeemanagement.MainApp</mainClass> 
</properties> 

<organization> 
    <!-- Used as the 'Vendor' for JNLP generation --> 
    <name>VirEmp Technologies International</name> 
</organization> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>com.zenjava</groupId> 
      <artifactId>javafx-maven-plugin</artifactId> 
      <version>8.6.0</version> 
      <configuration> 
       <mainClass>com.viremp.employeemanagement.MainApp</mainClass> 
       <bundler>EXE</bundler> 
       <needShortcut>true</needShortcut> 
       <appName>Employee Management System</appName> 
      </configuration> 
      <executions> 
       <execution> 
        <id>create-jfxjar</id> 
        <phase>package</phase> 
        <goals> 
         <goal>build-jar</goal> 
        </goals> 
       </execution> 
       <execution> 
        <id>create-native</id> 
        <phase>package</phase> 
        <goals> 
         <goal>build-native</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-dependency-plugin</artifactId> 
      <version>2.6</version> 
      <executions> 
       <execution> 
        <id>unpack-dependencies</id> 
        <phase>package</phase> 
        <goals> 
         <goal>unpack-dependencies</goal> 
        </goals> 
        <configuration> 
         <excludeScope>system</excludeScope> 
         <excludeGroupIds>junit,org.mockito,org.hamcrest</excludeGroupIds> 
         <outputDirectory>${project.build.directory}/classes</outputDirectory> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
     <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>exec-maven-plugin</artifactId> 
      <version>1.2.1</version> 
      <executions> 
       <execution> 
        <id>unpack-dependencies</id> 

        <phase>package</phase> 
        <goals> 
         <goal>exec</goal> 
        </goals> 
        <configuration> 
         <executable>${java.home}/../bin/javapackager</executable> 
         <arguments> 
          <argument>-createjar</argument> 
          <argument>-nocss2bin</argument> 
          <argument>-appclass</argument> 
          <argument>${mainClass}</argument> 
          <argument>-srcdir</argument> 
          <argument>${project.build.directory}/classes</argument> 
          <argument>-outdir</argument> 
          <argument>${project.build.directory}</argument> 
          <argument>-outfile</argument> 
          <argument>${project.build.finalName}.jar</argument> 
         </arguments> 
        </configuration> 
       </execution> 
       <execution> 
        <id>default-cli</id> 
        <goals> 
         <goal>exec</goal>        
        </goals> 
        <configuration> 
         <executable>${java.home}/bin/java</executable> 
         <commandlineArgs>${runfx.args}</commandlineArgs> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.1</version> 
      <configuration> 
       <source>8</source> 
       <target>8</target> 
       <compilerArguments> 
        <bootclasspath>${sun.boot.class.path}${path.separator}${java.home}/lib/jfxrt.jar</bootclasspath> 
       </compilerArguments> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.16</version> 
      <configuration> 
       <additionalClasspathElements> 
        <additionalClasspathElement>${java.home}/lib/jfxrt.jar</additionalClasspathElement> 
       </additionalClasspathElements> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 
<dependencies> 

    <dependency> 
     <groupId>com.jfoenix</groupId> 
     <artifactId>jfoenix</artifactId> 
     <version>1.3.0</version> 
    </dependency> 
    <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --> 
    <dependency> 
     <groupId>mysql</groupId> 
     <artifactId>mysql-connector-java</artifactId> 
     <version>6.0.6</version> 
    </dependency> 
    <!-- https://mvnrepository.com/artifact/commons-lang/commons-lang --> 
    <dependency> 
     <groupId>commons-lang</groupId> 
     <artifactId>commons-lang</artifactId> 
     <version>2.6</version> 
    </dependency> 


</dependencies> 

感謝です!

+1

'-X'でmvnを実行してエラーの詳細を取得してください – Jens

+0

Run Maven Build with goals clean installを試したことがありますか? –

+0

いいえ私は試していませんでした –

答えて

0

そのエラーは、しかし、私は他のエラーを削除すると思ったよりも、私はこれに戻ってこのエラーを削除しますが、私は他のエラーを削除したとき、魔法が起こったよりも、すべてのエラーは、MySQLと同様にpluginというエラーになります。

理由はわかりませんが、それは私のためのトリックでした。 他のエラーを削除してこの問題も削除した理由を知りませんが、このすべての関係は何ですか?

+0

おそらくメインクラスが利用可能になったからでしょう。実行すると、javapackagerを安全に実行できます。とにかく、あなたは乗りました。 –

1

execプラグインは、パス${java.home}/../bin/javapackagerのバイナリを実行します。

実行時に、エラーコード1を返します。これは、バイナリが見つからない可能性があります。

有効なJAVA_HOMEがあり、javapackagerが存在することを確認してください。 おそらく、あなたは新しいマシンのjreを持っていますか?私はそれは私が最初に私が削除されますよりも、このpluginエラーを解決しましょう考えていたその前に私は、実際にそれが原因MySQLに関連していた私のコードでいくつかの他のビルドエラーのエラーfailed to executeを投げていた、この問題を解決してきた

+0

答えは、それは私が直面していた問題ではありません。 –

関連する問題