Eclipse初次java开发问题总结-4-Maven使用问题汇总
Non-resolvable parent POM
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.iflytek.ossp:ossp-resserver-service:1.0.0-SNAPSHOT (C:\Users\moon\Desktop\ossp-resservice-maven\ossp-resserver-service\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not find artifact com.iflytek.ossp:ossp-resserver-all:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 11, column 10 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
无法解析父级的POM文件,应该是是POM文件中使用了继承。
<parent>
<groupId>com.iflytek.ossp</groupId>
<artifactId>ossp-resserver-all</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
可以尝试加入<relativePath>
<parent>
<groupId>com.iflytek.ossp</groupId>
<artifactId>ossp-resserver-all</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../ossp-resserver-all/pom.xml</relativePath>
</parent>
Unable to locate the Javac Compiler in
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project ossp-resserver-service: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Java\jre6\..\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.
[ERROR] -> [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/MojoFailureException
出现类似的错误应该是Jre配置问题:
右击项目->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包


Eclipse初次java开发问题总结-4-Maven使用问题汇总的更多相关文章
- Eclipse初次java开发问题总结-3
上篇中提到解决的一个问题是mysql驱动报的: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link ...
- Eclipse初次java开发问题总结-2
今天对之前写的servlet程序做了个简单的性能测试发现了一些问题,经过解决这些问题没有再重现,有些问题自己确切知道原因,有的则不太确定. 1.配置文件读取问题 项目中使用.properties作为配 ...
- eclipse,myeclipse开发环境下,maven远程部署到tomcat7服务器(图文)
有的人想在eclipse写java web 项目,通过maven也是一种实现的方法,可以实现java web 项目打包成war,发布到tomcat. 在pom.xml文件的build增加下面的代码,相 ...
- Jdk1.7+eclipse搭建Java开发环境
Jdk1.7+eclipse搭建Java开发环境 1. 下载jdk1.7 http://www.oracle.com/technetwork/java/javase/downloads/jdk7 ...
- Eclipse For Java开发环境部署
Eclipse For Java开发环境部署 1.准备工作 jdk安装包 jdk官网下载 Eclipse安装包 Eclipse官网下载 Eclipse下载时选择图中所示的国内镜像地址下载 下载后的文件 ...
- Java开发环境配置(4)--Maven安装 环境变量配置,本地仓库配置---插件安装
说明在前:本人用过的 luna mars 等,都已经自带maven插件的了,以下有些文章是很老的,讲到maven插件的安装都可以忽略掉. maven安装eclipse在线配置maven搞定所有插件_ ...
- linux下的Java开发 intellij idea+tomcat+maven
前期准备:安装intellij idea.下载tomcat.下载maven(注意我用的是tomcat6.maven 3.2.1.jdk1.6.0_45,之前maven用的3.5结果报错,搞了好久,建议 ...
- Java开发学习(三十)----Maven聚合和继承解析
一.聚合 分模块开发后,需要将这四个项目都安装到本地仓库,目前我们只能通过项目Maven面板的install来安装,并且需要安装四个,如果我们的项目足够多,那么一个个安装起来还是比较麻烦的 如果四个项 ...
- Java开发学习(三十一)----Maven属性与版本管理
一.属性 1.1 问题分析 如下图所示 你会发现,如果现在想更新Spring的版本,你会发现依然需要更新多个jar包的版本,这样的话还是有可能出现漏改导致程序出问题,而且改起来也是比较麻烦. 问题清楚 ...
随机推荐
- 【小白的CFD之旅】18 控制方程基础
忙碌了一个学期终于放暑假了,小白心情很愉快.然而想起CFD教材上的那些点缀着各种让人眼花缭乱符号的数学公式,整个人就不好了.不过这些事情小白也不好意思去麻烦师兄师姐们,还得靠自己去摸索.正好趁着暑假把 ...
- GGGGCCCC
Evaluating and improving remembered sets in the HotSpot G1 garbage collector http://www.diva-portal. ...
- Java Base64 编码解码方案总结
Base64是一种能将任意Binary资料用64种字元组合成字串的方法,而这个Binary资料和字串资料彼此之间是可以互相转换的,十分方便.在实际应用上,Base64除了能将Binary资料可视化之外 ...
- Linux系统Apache服务 - 配置HTTP的默认主页
1.安装HTTPD和httpd-manual软件包 # yum -y install http httpd-manual 2.创建/var/www/html/index.html 内容是 Hello ...
- C++11 类型推导decltype
我们之前使用的typeid运算符来查询一个变量的类型,这种类型查询在运行时进行.RTTI机制为每一个类型产生一个type_info类型的数据,而typeid查询返回的变量相应type_info数据,通 ...
- 每日英语:The Delicate Protocol Of Hugging
I'm not a hugger. When I see a registered personal-space invader coming my way at a party, the music ...
- java8的新特性以及用法简介
1. 介绍 2 接口的默认方法 2 lambda表达式 2.1 函数式接口 2.2 方法与构造函数引用 2.3 访问局部变量 2.4 访问对象字段与静态变量 3. 内建函数式接口 3.1 Predic ...
- 【Android】ADB常用指令与logcat日志
ADB命令简介 ADB是一个功能强大的命令行工具.通过它可以直接和模拟器或真机进行交互.它是一个具有客户端和服务器端的程序. 它主要由三个部分组成: 客户端,它运行在你的开发机上,你可以通过执行adb ...
- 【线程】linux之多线程同步互斥技术
1.同步机制 线程同步机制主要有:互斥量/信号量/条件变量/读写锁等. 2.技术示例 创建2个计数线程A和B,每次计数加1,当为偶数时,A线程计数:当为奇数时,B线程计数. 源码: ...
- Spark-shell引入第三方包
Spark-shell引入第三方包 如何引入 spark-shell --jars path/nscala-time_2.10-2.12.0.jar 若有多个jar包需要导入,中间用逗号隔开即可. s ...