In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you what are the problems of maven in eclipse, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Unrecognised tag
problem
Because I use the local proxy repository, the settings.xml settings are as follows:
NexusnexusNexus http://localhost:8081/nexus/content/groups/publictruetruenexusNexus http://localhost:8081/nexus/content/groups/publictruetrue nexus
However, the following exception was found in the Maven compilation Times:
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Unrecognised tag: 'activeProfiles' (position: START_TAG seen.\ n\ t. @ 269 Administrator.ZQFGROUP.000 18) @ C:\ Documents and Settings\ Administrator.ZQFGROUP.000\ .m2\ settings.xml, line 269, column 18
[WARNING]
Solve
This is because activeProfiles is configured in the profiles node by mistake. ActiveProfiles should be moved outside the profiles. For more settings.xml configuration information, please see here.
No goals
problem
After Eclipse has installed the Maven plug-in, right-click on the pom.xml of the project to see the following:
And I wisely thought that Maven build and mvn compile were equivalent, so I clicked on "Maven build..." again. After that, the "Goals" is empty, such as:
So he reported the following mistake:
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format:or: [:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [Help 1]
Solve
There are at least two solutions:
Click "Maven build..." again After that, enter the "Goals" you want to execute, such as compile,clean,test, etc.
Configure the default Goal in pom.xml, such as:
Clean
As a child node of project.
Not a JRE
problem
When configuring the default Goal using pom.xml, it is OK if the default Goal is clean, but if it is as follows:
An error will be reported:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project Demo: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\ Program Files\ Java\ jre7\..\ lib\ tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
After several attempts, it was found that it was not the problem of multiple Goal, but the problem of compile Goal. But the "mvn compile" that uses the command is also OK.
After several twists and turns, I found that the error said very clearly: "Please ensure you are using JDK 1.4 or above and not a JRE", it needs JDK instead of JRE. I gave the project to use public JRE:
Solve
Modify the configuration of Eclipse by using JDK:Eclipse- > Window- > Preferences- > Java- > Installed JREs
System propery is not set
Error:-Dmaven.multiModuleProjectDirectory system propery is not set.
Create a new environment variable M2_HOME that points to your maven installation directory
M2_HOME=D:\ study\ apache-maven-3.3.3
Then go to Window- > Preference- > Java- > Installed JREs- > Edit
Set up in Default VM arguments
-Dmaven.multiModuleProjectDirectory=$M2_HOME
5. Launching New_configuration
Right-click on the project-> Run/Debug Settings- > delete new_Configuration.
The above is all the content of the article "what are the problems of maven in eclipse?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.