无法执行目标org.codehaus.mojo:exec-maven-plugin:3.0.0:java

时间:2020-10-23 02:39:01

标签: java maven maven-plugin

我使用“ mvn install”和“ mvn exec:java”启动我的项目,但标题出现了错误。我应该将哪个确切的“ Mainclass”设置为“ mojo:exec-maven-plugin”?我试图删除完整的m2.repository,但是对我来说不起作用。我也尝试添加一些代码来设置插件,但是我不知道应该设置哪个主类。有人可以给我一些建议吗?

我的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>
    <developers>
        <developer>
            <id>TaehoonK</id>
            <name>Taehoon Kim</name>
            <email>taehoon.kim@pusan.ac.kr</email>
            <organization>Pusan National University</organization>
            <roles>
                <role>Module Maintainer</role>
                <role>Java Developer</role>
            </roles>
        </developer>
    </developers>
    <organization>
        <name>STEMLab in Pusan National University</name>
        <url>http://stem.pnu.edu</url>
    </organization>
    <properties>
        <jar.name>simmApplication</jar.name>
        <lib.dir>lib</lib.dir>
    </properties>

    <groupId>edu.pnu.stem</groupId>
    <artifactId>OpenGDS_Conversion</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <build>
        <plugins>
            <!-- ======================================================= -->
            <!-- JAR packaging. -->
            <!-- ======================================================= -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <finalName>${jar.name}</finalName>
                    <outputDirectory>${project.basedir}</outputDirectory>
                    <archive>
                        <manifest>
                            <mainClass>edu.pnu.stem.convert.MainForm</mainClass>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>${lib.dir}/</classpathPrefix>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <outputDirectory>${project.basedir}/${lib.dir}</outputDirectory>
                    <overWriteIfNewer>true</overWriteIfNewer>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>install</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <outputDirectory>${basedir}/target</outputDirectory>
                    <resources>
                        <resource>
                            <filtering>true</filtering>
                            <directory>${basedir}</directory>
                            <includes>
                                <include>VERSION.txt</include>
                            </includes>
                        </resource>
                    </resources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <fork>true</fork>
                    <encoding>utf-8</encoding>
                    <maxmem>512M</maxmem>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

0 个答案:

没有答案