微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决无法执行目标 org.codehaus.mojo:exec-maven-plugin:3.0.0

在我的计算机上安装 Java 后,我在 NetBeans 中收到以下错误

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project Project1: 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:[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

运行以下代码

public class Class1 {
    public static void main(String[] args){
        Scanner scan = new Scanner(system.in);
    
        System.out.println("What is your name?");
        String name = scan.nextLine();
        System.out.println("Your name is " + name);
    }
}

如果我只运行 System.out.println("What is your name?");代码,程序运行良好。


我在本网站的多个帖子中发现了相同(或类似)的错误,但我对编程非常陌生,所以我不明白答案。例如,在 this 帖子中,最受好评的答案指出“事实证明,我运行了 mvn clean package install。正确的方法是 mvn clean install”,并且在评论中他指出“我在命令行。我记得,Eclipse 允许创建构建任务。”

我一直试图弄清楚某些答案的含义,但没有取得多大成功。有人可以向初级程序员解释如何解决这个问题吗?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。