eclipse运行maven报错,怎么解决

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了eclipse运行maven报错,怎么解决相关的知识,希望对你有一定的参考价值。

右击项目->Java Buid Path->Libraries->JRE->Edit->Install JREs...->Edit->JRE system libraries->Add External JREs..->找到缺少的jar(toos.jar)添加进去。

No goals have been specified for this build.
Maven Buid时出现下面这个错误:

[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. 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-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException

是因为没有指定buid goal,在POM文件中的buid节中加入默认值就行了。
<defaultGoal>compile</defaultGoal>

将第三方jar包发布到私服
1、首先要修改eclipse中的Maven配置。

不要使用内嵌的默认配置。

指向Maven的安装目录。

2、配置Maven的setting.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>123</password>
</server>
</servers>
<mirrors>
</mirrors>

<profiles>
<profile>
<id>dev</id>
<repositories>
<repository>
<id>local-nexus</id>
<url>http://192.168.77.214:9088/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>dev</activeProfile>
</activeProfiles>
</settings>

3、发布第三方jar包

导入一个Maven项目之后发现有一个如下的错误:
Project configuration is not up-to-date with pom.xml. Run project configuration update
其实这个问题解决非常简单:
在项目上右键——【Maven】——【Update Project Configuration……】
这时会打开一个(Update Maven Dependencies)的对话框,然后勾选住出错的项目,点击Ok
这样就搞定了。
参考技术A 这不碍事,警告,不是错误就行,程序可以跑

以上是关于eclipse运行maven报错,怎么解决的主要内容,如果未能解决你的问题,请参考以下文章

maven的pom文件报错怎么解决(eclipse环境)

用eclipse创建一个maven管理的项目,创建完成后pom.xml报错!!急求怎么解决!!

pom.xml 报错,怎么解决

maven报错,怎么解决,我是新手。

eclipse在jsp界面上的第一行出现了报错,点报错的地方出现了这个,怎么回事?需要啥?

eclipse 在创建Maven项目时总是报错,怎么回事?