无法执行目标org.codehaus.mojo:exec-maven-plugin:1.2.1:exec(default-cli)

时间:2016-06-30 14:21:30

标签: java maven jpa

我需要为学校做一个Maven项目。

这是一个使用JPA的项目。我添加了所有必需的依赖项。当我运行该项目时,我收到以下错误:

  

无法在项目se42Her上执行目标org.codehaus.mojo:exec-maven-plugin:1.2.1:exec(default-cli):命令执行失败。退出并出现错误:1(退出值:1) - > [帮助1]

我之前检查了很多问题但是没有用。我在下面添加了我的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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>nl.se42HER</groupId>
<artifactId>se42Her</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>se42Her</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <mainClass>nl.se42her.se42her.MainApp</mainClass>
</properties>

<organization>
    <!-- Used as the 'Vendor' for JNLP generation -->
    <name>Your Organisation</name>
</organization>

<build>
    <plugins>
        <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/javafxpackager</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>1.7</source>
                <target>1.7</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>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.33</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>eclipselink</artifactId>
        <version>2.5.2</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
        <version>2.5.2</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

我得到的错误:

错误1:

  

java.lang.SecurityException:无效的签名文件摘要   显示主要属性   sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:284)     在   sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:238)     在java.util.jar.JarVerifier.processEntry(JarVerifier.java:273)at   java.util.jar.JarVerifier.update(JarVerifier.java:228)at at   java.util.jar.JarFile.initializeVerifier(JarFile.java:383)at at   java.util.jar.JarFile.getInputStream(JarFile.java:450)at at   sun.misc.JarIndex.getJarIndex(JarIndex.java:137)at   sun.misc.URLClassPath $ JarLoader $ 1.run(URLClassPath.java:839)at at   sun.misc.URLClassPath $ JarLoader $ 1.run(URLClassPath.java:831)at   java.security.AccessController.doPrivileged(Native Method)at   sun.misc.URLClassPath $ JarLoader.ensureOpen(URLClassPath.java:830)at at   sun.misc.URLClassPath $ JarLoader。(URLClassPath.java:803)at   sun.misc.URLClassPath $ 3.run(URLClassPath.java:530)at   sun.misc.URLClassPath $ 3.run(URLClassPath.java:520)at   java.security.AccessController.doPrivileged(Native Method)at   sun.misc.URLClassPath.getLoader(URLClassPath.java:519)at   sun.misc.URLClassPath.getLoader(URLClassPath.java:492)at   sun.misc.URLClassPath.getNextLoader(URLClassPath.java:457)at   sun.misc.URLClassPath.getResource(URLClassPath.java:211)at   java.net.URLClassLoader $ 1.run(URLClassLoader.java:365)at   java.net.URLClassLoader $ 1.run(URLClassLoader.java:362)at   java.security.AccessController.doPrivileged(Native Method)at   java.net.URLClassLoader.findClass(URLClassLoader.java:361)at   java.lang.ClassLoader.loadClass(ClassLoader.java:424)at   sun.misc.Launcher $ AppClassLoader.loadClass(Launcher.java:331)at at   java.lang.ClassLoader.loadClass(ClassLoader.java:357)at   sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)   错误:发生了JNI错误,请检查您的安装和   再次尝试线程“main”中的异常

错误2:

  

INFO [org.netbeans.spi.lexer.MutableTextInput]:!!警告!!失踪   访问TokenHierarchy时的READ-LOCK:   输入源:org.netbeans.modules.editor.NbEditorDocument@1ae8c632,   mimeType ='text / x-maven-pom + xml',kitClass = null,length = 5342,   版本= 13,   file=org.netbeans.modules.maven.grammar.POMDataObject@467490 [C:\用户\ Tjidde   纽文豪生\文档\ GitHub的\ SE42Her \ se42Her \ pom.xml@4283ecb8:2052c29a]   java.lang.Exception at   org.netbeans.lib.lexer.TokenHierarchyOperation.ensureReadLocked(TokenHierarchyOperation.java:406)     在   org.netbeans.lib.lexer.TokenHierarchyOperation.tokenSequence(TokenHierarchyOperation.java:431)     在   org.netbeans.lib.lexer.TokenHierarchyOperation.tokenSequence(TokenHierarchyOperation.java:427)     在   org.netbeans.api.lexer.TokenHierarchy.tokenSequence(TokenHierarchy.java:186)     在   org.netbeans.modules.xml.text.completion.XMLCompletionQuery.shouldCloseTag(XMLCompletionQuery.java:468)     在   org.netbeans.modules.xml.text.completion.XMLCompletionQuery.queryValues(XMLCompletionQuery.java:351)     在   org.netbeans.modules.xml.text.completion.XMLCompletionQuery.query(XMLCompletionQuery.java:127)     在   org.netbeans.modules.xml.text.completion.XMLCompletionProvider $ Query.query(XMLCompletionProvider.java:124)     在   org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:223)     在   org.openide.util.RequestProcessor $ Task.run(RequestProcessor.java:1443)     在   org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)     在org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)at   org.openide.util.RequestProcessor $ Processor.run(RequestProcessor.java:2058)

我正在尝试运行以下代码。 使用https://github.com/tjidde-nl/SE42Her/blob/master/se42Her/src/main/java/nl/se42her/se42her/FXMLController.java https://github.com/tjidde-nl/SE42Her/blob/master/se42Her/src/main/java/DOA/CustomerDAOImpl.java

0 个答案:

没有答案