当前位置: 首页 > 知识库问答 >
问题:

JAVA如何修复错误>无法执行目标组织。科德豪斯。project sic桌面上的mojo:exec maven插件:1.2.1:exec(默认cli):

宗政文彬
2023-03-14

我使用的是netbeans,而不是maven。编译是正常的,但当试图运行它时,我得到了这个错误:无法执行目标组织。科德豪斯。project sic desktop上的mojo:exec maven插件:1.2.1:exec(默认cli):命令执行失败。进程已退出,但出现错误:-1(退出值:-1)-

下面是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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>com.techint</groupId>
    <artifactId>sic-parent</artifactId>
    <version>1.0</version>
</parent>
<artifactId>sic-desktop</artifactId>


<dependencies>
    <dependency>
        <groupId>com.techint</groupId>
        <artifactId>sic-core</artifactId>
        <version>${project.parent.version}</version>
    </dependency>
    <dependency>
        <groupId>com.techint</groupId>
        <artifactId>sic-ca</artifactId>
        <version>${project.parent.version}</version>
    </dependency>

    <dependency>
        <groupId>org.netbeans.external</groupId>
        <artifactId>AbsoluteLayout</artifactId>
    </dependency>

    <dependency>
        <groupId>org.jdesktop</groupId>
        <artifactId>beansbinding</artifactId>
    </dependency>


    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.instrument</artifactId>
    </dependency>
    <!--  Spring Security  -->
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
    </dependency>

    <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports</artifactId>
    </dependency>
    <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports-fonts</artifactId>
    </dependency>



    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
    </dependency>




    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
    </dependency>
    <dependency>
        <groupId>net.sourceforge.jtds</groupId>
        <artifactId>jtds</artifactId>
    </dependency>


</dependencies>


<build>
    <plugins>
        <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <classpathPrefix>lib/</classpathPrefix>
                        <mainClass>com.techint.comissionamento.ComissionamentoMain</mainClass>
                    </manifest>

                </archive>
            </configuration>
        </plugin>


        <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <phase>install</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/lib</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>



        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <version>2.0</version>
        </plugin>

        <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
                <execution>
                    <phase>prepare-package</phase>
                    <configuration>
                        <tasks>
                            <replace token="@buildnumber@" value="${project.version}.${buildNumber}"
                                     dir="target/classes">
                                <include name="app.properties"/>
                            </replace>
                        </tasks>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>


    </plugins>

    <!--<finalName>${project.name}-${project.version}.${buildNumber}</finalName>-->
    <finalName>Comissionamento</finalName>
</build>


<profiles>

    <profile>
        <id>dev</id>
        <properties>
            <maven.test.skip>true</maven.test.skip>
        </properties>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                                <tasks>
                                    <copy file="${project.parent.basedir}/config/epccom/app.dev.properties"
                                          tofile="${project.build.outputDirectory}/app.properties"/>
                                </tasks>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>buildnumber-maven-plugin</artifactId>
                    <version>1.1</version>
                    <executions>
                        <execution>
                            <phase>validate</phase>
                            <goals>
                                <goal>create</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <doCheck>false</doCheck>
                        <doUpdate>false</doUpdate>
                    </configuration>
                </plugin>


            </plugins>
        </build>
    </profile>
    <profile>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <id>prod</id>
        <properties>
            <maven.test.skip>true</maven.test.skip>
        </properties>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                            <configuration>
                                <tasks>
                                    <copy file="${project.parent.basedir}/config/epccom/app.prod.properties"
                                          tofile="${project.build.outputDirectory}/app.properties"/>
                                </tasks>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>buildnumber-maven-plugin</artifactId>
                    <version>1.1</version>
                    <executions>
                        <execution>
                            <phase>validate</phase>
                            <goals>
                                <goal>create</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <doCheck>false</doCheck>
                        <doUpdate>false</doUpdate>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>jasperreports-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile-reports</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <sourceDirectory>src/main/jaspertreports</sourceDirectory>
                        <outputDirectory>${project.build.outputDirectory}/reports</outputDirectory>
                    </configuration>

                    <dependencies>
                        <!--note this must be repeated here to pick up correct xml validation -->
                        <dependency>
                            <groupId>net.sf.jasperreports</groupId>
                            <artifactId>jasperreports</artifactId>
                            <version>${jasperreports.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

共有1个答案

江阳冰
2023-03-14

如果您使用的是netbeans,那么请停止当前的运行进程并再次启动它。由于您有一个正在运行的进程,因此会出现此错误

 类似资料: