【问题标题】:Maven error during the compilation in netbeans在netbeans中编译期间的Maven错误
【发布时间】:2020-04-17 05:57:58
【问题描述】:

当我在 netbeans 中执行我的第一个 java 应用程序时,我被要求安装一些与 maven 相关的东西,但安装失败了。

“运行项目(F6)”:

cd /home/sagecat/Documents/Study/Cross-platform_programming_tools/working_directory/Lab2/Lab2; JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 /opt/netbeans/java/maven/bin/mvn "-Dexec.args=-classpath %classpath edu.sora.lab2.Lab2_Pavlenko_KI33" -Dexec.executable=/usr/lib/jvm/java-11-openjdk-amd64/bin/java -Dfile.encoding=UTF-8 org.codehaus.mojo:exec-maven-plugin:1.5.0:exec
Running NetBeans Compile On Save execution. Phase execution is skipped and output directories of dependency projects (with Compile on Save turned on) will be used instead of their jar artifacts.
Scanning for projects...

------------------------------------------------------------------------
Building Lab2 1.0-SNAPSHOT
------------------------------------------------------------------------

--- exec-maven-plugin:1.5.0:exec (default-cli) @ Lab2 ---
??????? ?????? ?????????? ???????: 

“清理并构建 (SHIFT + F11)”成功!!!
(为什么“运行项目(F6)”效果不好???我很困惑):

cd /home/sagecat/Documents/Study/Cross-platform_programming_tools/working_directory/Lab2/Lab2; JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 /opt/netbeans/java/maven/bin/mvn -Dfile.encoding=UTF-8 clean install
Scanning for projects...

------------------------------------------------------------------------
Building Lab2 1.0-SNAPSHOT
------------------------------------------------------------------------

--- maven-clean-plugin:2.5:clean (default-clean) @ Lab2 ---
Deleting /home/sagecat/Documents/Study/Cross-platform_programming_tools/working_directory/Lab2/Lab2/target

--- maven-resources-plugin:2.6:resources (default-resources) @ Lab2 ---
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory /home/sagecat/Documents/Study/Cross-platform_programming_tools/working_directory/Lab2/Lab2/src/main/resources

--- maven-compiler-plugin:3.1:compile (default-compile) @ Lab2 ---
Changes detected - recompiling the module!
Compiling 1 source file to /home/sagecat/Documents/Study/Cross-platform_programming_tools/working_directory/Lab2/Lab2/target/classes

--- maven-resources-plugin:2.6:testResources (default-testResources) @ Lab2 ---
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory /home/sagecat/Documents/Study/Cross-platform_programming_tools/working_directory/Lab2/Lab2/src/test/resources

--- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ Lab2 ---
Nothing to compile - all classes are up to date

--- maven-surefire-plugin:2.12.4:test (default-test) @ Lab2 ---
No tests to run.

--- maven-jar-plugin:2.4:jar (default-jar) @ Lab2 ---
Building jar: /home/sagecat/Documents/Study/Cross-platform_programming_tools/working_directory/Lab2/Lab2/target/Lab2-1.0-SNAPSHOT.jar

--- maven-install-plugin:2.4:install (default-install) @ Lab2 ---
Installing /home/sagecat/Documents/Study/Cross-platform_programming_tools/working_directory/Lab2/Lab2/target/Lab2-1.0-SNAPSHOT.jar to /home/sagecat/.m2/repository/edu/sora/Lab2/1.0-SNAPSHOT/Lab2-1.0-SNAPSHOT.jar
Installing /home/sagecat/Documents/Study/Cross-platform_programming_tools/working_directory/Lab2/Lab2/pom.xml to /home/sagecat/.m2/repository/edu/sora/Lab2/1.0-SNAPSHOT/Lab2-1.0-SNAPSHOT.pom
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 1.128 s
Finished at: 2020-04-17T14:02:44+03:00
Final Memory: 13M/50M
------------------------------------------------------------------------

也许有用的信息:

“maven”搜索的可用插件:

已安装的插件:

java* 类别中的所有可用插件:

【问题讨论】:

    标签: java maven netbeans maven-plugin netbeans-8


    【解决方案1】:

    你需要在 netbeans 中安装 maven 插件。为此,请转到工具 -> 插件。 在可用的插件部分中,选择 Maven Plugin for JAVA。安装它并且必须激活它。 This Plugin is must

    If this is not available in Available plugin List then check in other tabs

    【讨论】:

    • 没有这样的插件可供选择。这是一个“Maven runner”,我已经安装了它,但没有任何改变。
    • 请通过导航至此-> 工具-> 选项...检查您的工作区中是否有 Maven 选项卡。
    • 如果它可用,那么您需要将 Maven Home 设置为指向您的 Maven 二进制文件
    • Maven 选项卡工具->选项->Java->Maven 可用。我需要设置 Maven->Experimental->(使用以下位置存储 Maven 二进制文件),是吗?如果是这样,我怎样才能找到 Maven 二进制文件目录?
    • 没有改变(((
    【解决方案2】:

    已解决!

    我不知道实际上有什么帮助...抱歉=(

    我尝试了一切并安装了很多东西,还使用突触重新安装了所有 maven 包。下次我尝试时,效果很好。

    【讨论】:

      猜你喜欢
      • 2018-09-20
      • 2019-11-18
      • 1970-01-01
      • 2014-09-24
      • 2015-11-25
      • 2012-04-15
      • 1970-01-01
      • 2010-10-25
      • 1970-01-01
      相关资源
      最近更新 更多