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节中加入默认值就行了。(在pom.xml文件<build>标签后面加 上<defaultGoal>compile</defaultGoal>即可)

<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包

时间: 2024-10-12 09:30:20

Maven使用问题汇总的相关文章

idea 下的maven使用问题汇总

1,-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.[ERROR] Maven execution terminated abnormally (exit code 1) 解决方案:在runner下的run in backqround中加-Dmaven.multiModuleProjectDirectory

Maven进价:Maven构建错误汇总

问题:The method of type must override asuperclass? annotation:@Override的原因 办法:项目右键->build path->configure build path->java Compiler(左边那排中) ->在右边的Compiler compliance level 修改版本为 6.0 参考:http://linhfgo.iteye.com/blog/1470996 问题:Failed to execute go

Eclipse中新建maven项目错误汇总

1,初始目录意义: maven项目自动生成三个目录,重点是这三个目录既不是包,也不是文件夹,都是根目录: src/main/java:根目录 src/main/resources:跟目录,和src/main/java同一文件夹, src/test/java:测试文件夹 2,src/main/java missing(不显示该路径,但是已经具有) 解决方法:在项目上右键选择properties,然后点击java build path,在Librarys下,编辑JRE System Library,

Maven 实战常用汇总

01. maven 概要 首先我把 maven 的概念快速的梳理一下,让我们快速地建立起一个比较精确的 maven 应用场景. maven 不是 ant,也不是 make,以前接触的构建工具,需要写一些详细的步骤,如: compile project1/src/*.java 等类似的语句. maven 采用了"约定优于配置"的方法,一些开发常用的操作和步骤已经固化在 maven中,所以使用者不再需要编写那些语句. maven 内置了开发流程的支持,它不仅能够编译,同样能够打包.发布,也

maven 使用问题汇总

(1)Maven坐标 maven坐标可以唯一标识一个项目,包含四个元素 groupId , artifactId, packaging, version. groupId:一般为团体,公司,项目.如 oceanic-web, oceanic-dal, oceanic-biz 同属一个 groupId. artifactId:在 groupId 下的表示一个单独项目的唯一标识符.项目名称ID/模块名称 . packaging:标识项目的类型,如 jar,war,pom 等. version:版本号

Maven出错问题解决汇总

pom.xml顶部报错问题解决方法:http://stackoverflow.com/questions/5074063/maven-error-failure-to-transfer#comment15423924_7108536

零基础学习 Hadoop 如何下手

想学习hadoop,可是苦于自己没有任何的基础,不知道该如何下手,也不知道自己能不能学会.其实零基础学习hadoop,没有想象的那么困难.曾经我也是一位小白,刚接触到云计算,想过培训,但是培训机构的选择也让我很纠结,就自己开始去摸索学习,现在我把自己的学习思路整理一下,希望对大家有帮助. 首先整体说一下学习过程给大家借鉴: 一.了解hadoop: 这里不具体阐述概念,有兴趣的同学可以自己上网去查.我们知道hadoop,有单机安装,伪分布安装和分布安装.同时hadoop的环境是Linux,所以我们

零基础学习hadoop到上手工作线路指导(编程篇)

问题导读:1.hadoop编程需要哪些基础?2.hadoop编程需要注意哪些问题?3.如何创建mapreduce程序及其包含几部分?4.如何远程连接eclipse,可能会遇到什么问题?5.如何编译hadoop源码? 阅读此篇文章,需要些基础下面两篇文章零基础学习hadoop到上手工作线路指导(初级篇) 零基础学习hadoop到上手工作线路指导(中级篇)如果看过的话,看这篇不成问题,此篇讲hadoop编程篇. hadoop编程,hadoop是一个Java框架,同时也是编程的一次革命,使得传统开发运

零基础学习hadoop到上手工作线路指导

问题导读: 1.hadoop编程需要哪些基础? 2.hadoop编程需要注意哪些问题? 3.如何创建mapreduce程序及其包含几部分? 4.如何远程连接eclipse,可能会遇到什么问题? 5.如何编译hadoop源码? 阅读此篇文章,需要些基础下面两篇文章 零基础学习hadoop到上手工作线路指导(初级篇) http://www.aboutyun.com/thread-6780-1-1.html 零基础学习hadoop到上手工作线路指导(中级篇) http://www.aboutyun.c