yzc579亚洲城官网 1

首先从https://github.com/alibaba/dubbo/archive/master.zip下载最新源码,近期新星版本为2.5.4-SNAPSHOT。
解压文件。

 

上边截图是自己在新建maven项指标时候报错音讯提示,笔者是那般消除的

    cd dubbo  
    mvn clean install -Dmaven.test.skip  

child module ….pom.xml does not exist

一.在pom.xml文件中投入maven-resources-plugin配置

报错:

a.注意module的名目是不是精确,有的时候候命名难点会促成找不到项指标
b.注意一同来项目命名的规则难题放在心上一上马项目命名的平整难题

<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.4.3</version>
</dependency>
Non-resolvable parent POM: Could not transfer artifact com.alibaba:opensesame:pom:2.0 from/to opensesame.releases (http://code.alibabatech.com/mvn/releases)

 yzc579亚洲城官网 2

2.开荒cmd窗口,运转mvn
install,这么些历程可能会报错,依照提醒音信一步步的去考订

README上一度认证了亟待地点安装“由于开源站点因为安全难题被下掉,假设编写翻译时出现找不到opensesame重视意况的,请先手动下载https://github.com/alibaba/opensesame”,那就融洽设置吧

 

yzc579亚洲城官网 3

下载opensesame,之后进入opensesame目录,实行:mvn install
等待success吧
重新执行:

 

先消除第3个Error,大约意思是跟.m2同级目录C:/users/zxw下未有POM,把工程中的pom拷贝到钦点目录下边,再一次运营mvn
install

mvn clean install -Dmaven.test.skip

 

假若您的settings.xml有标题,下一步还恐怕会唤醒小编settings.xml不日常,查看难题出在第几行,然后去修改,小编的是因为格式难题,就不描述了,在此提供多少个mirror

又是一批的失实啊:

使用maven-compiler-plugin 时
POM文件如下:

    <mirror>
        <id>repo2</id>
        <mirrorOf>central</mirrorOf>
        <name>Human Readable Name for this Mirror.</name>
        <url>http://repo2.maven.org/maven2/</url>
    </mirror>
    <mirror>
        <id>nexus-osc-thirdparty</id>
        <mirrorOf>thirdparty</mirrorOf>
        <name>Nexus osc thirdparty</name>
        <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
    </mirror>
[ERROR] Failed to execute goal on project dubbo-common: Could not resolve dependencies for project com.alibaba:dubbo-common:jar:2.5.4-SNAPSHOT: Failed to collect dependencies for [org.slf4j:slf4j-api:jar:1.6.2 (provided), commons-logging:commons-logging-api:jar:1.1 (provided), log4j:log4j:jar:1.2.16 (compile), org.javassist:javassist:jar:3.15.0-GA (compile), com.alibaba:hessian-lite:jar:3.2.1-fixed-2 (compile), com.alibaba:fastjson:jar:1.1.8 (provided), org.jvnet.sorcerer:sorcerer-javac:jar:0.8 (provided), cglib:cglib-nodep:jar:2.2 (test), junit:junit:jar:4.10 (test), org.easymock:easymock:jar:3.0 (test), org.easymock:easymockclassextension:jar:3.0 (test), com.googlecode.jmockit:jmockit:jar:0.999.8 (test)]: Failed to read artifact descriptor for com.alibaba:hessian-lite:jar:3.2.1-fixed-2: Could not transfer artifact com.alibaba:hessian-lite:pom:3.2.1-fixed-2 from/to opensesame.releases (http://code.alibabatech.com/mvn/releases): Connection to http://code.alibabatech.com refused: Connection refused -> [Help 1]
<plugins>  
    <plugin>  
        <artifactId>maven-compiler-plugin</artifactId>  
        <configuration>  
            <source>1.6</source>  
            <target>1.6</target>  
            <encoding>UTF-8</encoding>  
        </configuration>  
    </plugin>  
</plugins>   

推荐应用方面包车型大巴那二个

大多文书从Ali的库房中都找不到了,随地找消除措施啊。在那么些贴子上有提到了改造配置货仓:<a
href=”;

[WARNING] Some problems were encountered while building the effective
model for com.xxx.xxx:xxxx:jar:0.0.1-SNAPSHOT 
[WARNING] ‘build.plugins.plugin.version’ for
org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 72,
column 12

再度实践mvn
-install之后,就能下载一些插件,静静等待下载落成后,右键工程,选用maven→update
project,等待更新已毕,maven项目就建好了

    <mirror>
    <id>kafeitu</id>
    <mirrorOf>central</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://maven.kafeitu.me/nexus/content/repositories/public</url>
    </mirror>
    <mirror>
    <id>ibiblio.org</id>
    <name>ibiblio Mirror of http://repo1.maven.org/maven2/</name>
    <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
    <mirrorOf>*</mirrorOf>
    </mirror>
    <mirror>
    <id>lvu.cn</id>
    <name>lvu.cn</name>
    <url>http://lvu.cn/nexus/content/groups/public</url>
    <mirrorOf>*</mirrorOf>
    </mirror>

 

将方面包车型地铁布署参加maven配置文件setting.xml中

修改后如下,OK了 

再也施行:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
mvn clean install -Dmaven.test.skip  

 

照例报错:

Configuring Your Compiler Plugin
Since the Compiler Plugin executes automatically during their phases,
you don’t have to put executions unlike many other plugins. However, you
should specify the version of the Compiler Plugin.

[ERROR] Failed to execute goal on project dubbo-common: Could not resolve dependencies for project com.alibaba:dubbo-common:jar:2.5.4-SNAPSHOT: Failed to collect dependencies for [org.slf4j:slf4j-api:jar:1.6.2 (provided), commons-logging:commons-logging-api:jar:1.1 (provided), log4j:log4j:jar:1.2.16 (compile), org.javassist:javassist:jar:3.15.0-GA (compile), com.alibaba:hessian-lite:jar:3.2.1-fixed-2 (compile), com.alibaba:fastjson:jar:1.1.8 (provided), org.jvnet.sorcerer:sorcerer-javac:jar:0.8 (provided), cglib:cglib-nodep:jar:2.2 (test), junit:junit:jar:4.10 (test), org.easymock:easymock:jar:3.0 (test), org.easymock:easymockclassextension:jar:3.0 (test), com.googlecode.jmockit:jmockit:jar:0.999.8 (test)]: Failed to read artifact descriptor for com.alibaba:hessian-lite:jar:3.2.1-fixed-2: Could not find artifact com.alibaba:opensesame:pom:1.0 in ibiblio.org (http://mirrors.ibiblio.org/pub/mirrors/maven2) -> [Help 1]
<project>
  ...
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.6.1</version>
          <configuration>
            <!-- put your configurations here -->
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  ...
</project>

在那几个错误文件中发掘了Could not find artifact
com.alibaba:opensesame:pom:1.0,不是二.0么,怎么1.0也要。既然必要,那吾就给呗。
还记得下边本人下载的opensesame源码不,修改下边包车型大巴pom.xml,将
<version>2.0</version>中二.0改造为一.0
执行 mvn install 等待success吧

再度实践:

 

mvn clean install -Dmaven.test.skip

 

一如从前出错

maven install生成最后的预制构件包xxx-一.0.0.war(xxx-一.0.0.jar)后,
在其下的WEB-INF/lib(xxx-一.0.0.jar\BOOT-INF\lib)中,会包罗大家被标记为scope=compile的构件的jar包,
而不会含有大家被标注为scope=provided的预制构件的jar包。那也防止了此类构件当计划到目的容器后发生包重视争执。 

[ERROR] Failed to execute goal on project dubbo-common: Could not resolve dependencies for project com.alibaba:dubbo-common:jar:2.5.4-SNAPSHOT: Could not find artifact com.alibaba:fastjson:jar:1.1.8 in ibiblio.org (http://mirrors.ibiblio.org/pub/mirrors/maven2) -> [Help 1]

 

而是总的来看那么多的错误一下便少了,心绪如故暗爽的,哈哈。
到http://maven.kafeitu.me/nexus/content/repositories/public/其一地点看了下fastjson可用版本有一.1.3玖,于是修改pom.xml,找到
<fastjson_version>1.1.8</fastjson_version>,将1.1.8修改为1.1.39

借助范围调整什么正视在怎样classpath
中可用,哪些重视包括在3个运用中。让我们详细看一下每一种限制:
compile (编写翻译范围)
compile是暗中同意的范围;要是未有提供3个限制,那该依赖的界定就是编写翻译范围。编写翻译范围正视在具有的classpath
中可用,同一时间它们也会被打包。

再也实践:

provided (已提供范围)
provided 倚重唯有在当JDK 也许2个容器已提供该重视之后才使用。比如,
要是你付出了1个web 应用,你可能在编写翻译 classpath 中须求可用的Servlet API
来编译一个servlet,不过你不会想要在打包好的WA卡宴 中含有那个Servlet
API;那一个Servlet API JA奇骏 由你的应用服务器只怕servlet
容器提供。已提供范围的正视在编写翻译classpath (不是运作时)可用。它们不是传递性的,也不会被打包

mvn clean install -Dmaven.test.skip  

runtime (运转时界定)
runtime 正视在运转和测试系统的时候供给,但在编写翻译的时候无需。举个例子,你可能在编写翻译的时候只须求JDBC
API JA猎豹CS6,而唯有在运转的时候才需求JDBC
使得完结。

笔者靠依旧有错,本次依旧是

test (测试范围)
test范围依赖在形似的编写翻译和平运动行时都没有要求,它们唯有在测试编译和测试运维阶段可用。

    java.lang.OutOfMemoryError: PermGen space  

system (系统范围)
system范围重视与provided 类似,然则你必须显式的提供三个对于本地系统中JAEscort文件的路线。这么做是为了允许基于本地对象编写翻译,而那么些目的是系统类库的壹部分。那样的部件应该是直接可用的,Maven
也不会在仓房中去探求它。假设您将3个重视范围设置成系统范围,你必须同期提供二个systemPath
成分。注意该限量是不引入应用的(你应有间接尽心去从国有或定制的 Maven
客栈中援引信赖)。

不怕不令人方便啊,继续解决,选用严酷直接的章程,直接修改maven安装目录下bin/mvn,在上头加上那一个

 

MAVEN_OPTS="$MAVEN_OPTS -Xms256m -Xmx1024m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=64m" 

 

现实大小,可依照本身的意况调节
双重实施:

package阶段得到的是build目录下编写翻译后的类包(jar),
install是把这几个包和部分maven的元信息(比如pom.xml)复制到当地仓库,
assembly一般是把build结果和一些能源文件组成3个得以对外发布的包(zip包等),安排会用到。

mvn clean install -Dmaven.test.skip
Non-resolvable parent POM: Could not find artifact com.tangcheng:dubbo:pom:0.0.1-SNAPSHOT and 'parent.relativePath' points at no local POM @ line 14, column 13 -> [Help 2]

可能出错了啊呀呀…

原因:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project dubbo-rpc-redis: Compilation failure: Compilation failure:
[ERROR] /home/pengkw/opensource/dubbo-dubbo-2.4.10/dubbo-rpc/dubbo-rpc-redis/src/main/java/com/alibaba/dubbo/rpc/protocol/redis/RedisProtocol.java:[25,35] package org.apache.commons.pool.impl does not exist
[ERROR] /home/pengkw/opensource/dubbo-dubbo-2.4.10/dubbo-rpc/dubbo-rpc-redis/src/main/java/com/alibaba/dubbo/rpc/protocol/redis/RedisProtocol.java:[71,29] package GenericObjectPool does not exist
[ERROR] /home/pengkw/opensource/dubbo-dubbo-2.4.10/dubbo-rpc/dubbo-rpc-redis/src/main/java/com/alibaba/dubbo/rpc/protocol/redis/RedisProtocol.java:[71,67] package GenericObjectPool does not exist
[ERROR] /home/pengkw/opensource/dubbo-dubbo-2.4.10/dubbo-rpc/dubbo-rpc-redis/src/main/java/com/alibaba/dubbo/rpc/protocol/redis/RedisProtocol.java:[89,40] cannot access org.apache.commons.pool.PoolableObjectFactory
[ERROR] class file for org.apache.commons.pool.PoolableObjectFactory not found
[ERROR] final JedisPool jedisPool = new JedisPool(config, url.getHost(), url.getPort(DEFAULT_PORT),
[ERROR] -> [Help 1]

发端新的五个模块的品种时,个中的parent项目要先install贰遍。
哪怕新建了父项目后,一定要运营mvn install命令,本事营造子项目

一向上消除形式:分别修改dubbo-rpc/dubbo-rpc-redis/pom.xml和dubbo-registry/dubbo-registry-redis/pom.xml文件,在dependencies下进入jar包注重

解决办法:把pom中的modules删除,然后实行mvn
install。然后ctrl+z把刚刚剔除的音讯过来。

<dependency>
    <groupId>commons-pool</groupId>
    <artifactId>commons-pool</artifactId>
    <version>1.6</version>
</dependency>

 

再次施行:
mvn clean install -Dmaven.test.skip
通过一段悠久的历程,终于见到了build success

1、

可以吗,至此整个源码的编写翻译进程已经完成,本人并未什么难度,只是因为远远不足相关的jar和情状安插,导致一多种的主题素材。

Failure to transfer org.apache.poi:poi-ooxml-schemas:jar:3.10.1 from
was cached in the local
repository,
resolution will not be reattempted until the update interval of central
has elapsed or updates are forced.
Original error: Could not transfer artifact
org.apache.poi:poi-ooxml-schemas:jar:3.10.1 from/to central
():
Connection reset。

那句话的情趣是:
对于这几个包从maven大旨传输到本地酒店战败,决定不会重复尝试下载jar包,直到mavne再改更新索引,或强制更新。

实在的消除办法是:直接去地点货仓(local
repository),把这一个org.apache.poi存放的目录删除掉(因为包未有下载下来),
(一)刷新你的体系(在档案的次序上点右键–>刷新);
(2)在您的项目上右击,采取maven—>update(刷新Maven陈设)就能够了,让maven重新下载;
(三)编写翻译maven项目。在类型上点右键–>Run As –>Maven build

利用验证:
假诺pom.xml中布局的jar不能够下载,提示pom.xml中报错,反复使用(1)和(二)操作;
一旦pom.xml文件并未有报错,就应用(三)来拍卖;

 

 

2、

Using platform encoding (GBK actually) to copy filtered resources, i.e.
build is platform dependent!
注:
只要项目编码设为utf-8,maven-resources-plugin假如选择windows自带的GBK编码,则就汇合世乱码。乱码后就能够编写翻译可是。

化解办法:
在pom.xml中build-plugins下将plugin:maven-resources-plugin设置为与品种的编码一致就能够。举例此处设置为UTF-8

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
        <finalName>defalut_goal</finalName>
        <defaultGoal>compile</defaultGoal>
    </build>

 

3、
eclipse安装的maven插件是m二eclipse,使用命令行时就曾经钦赐了phase,而利用m二eclipse的【Run
As】-【Maven build】时未有为其钦定goal或phase
在pom.xml中指定defaultGoal的方式:

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
        <finalName>defalut_goal</finalName>
        <defaultGoal>compile</defaultGoal>
    </build>

此间钦赐为compile

在eclipse中钦点(第三次采用应用Maven build时会弹出此对话框):
yzc579亚洲城官网 4

4、
maven 下载 源码和javadoc命令

(1)Maven命令下载源码和javadocs
当在IDE中动用Maven时一旦想要看引用的jar包中类的源码和javadoc须要经过maven命令下载这几个源码,然后再进行引入,通过mvn命令能够轻巧的完结那么些目标:
mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc
命令使用办法:首先进入到对应的pom.xml目录中,然后推行以上命令:
率先个指令是尝尝下载在pom.xml中依附的文本的源代码。
第四个指令:是尝试下载对应的javadocs
然则有极大希望有的文本并未源代码大概javadocs

(2)通过配备文件增多
开辟maven配置文件 setting.xml文件(…/.m2/settings.xml) 扩充如下配置:

<profiles>
<profile>
    <id>downloadSources</id>
    <properties>
        <downloadSources>true</downloadSources>
        <downloadJavadocs>true</downloadJavadocs>           
    </properties>
</profile>
</profiles>

<activeProfiles>
  <activeProfile>downloadSources</activeProfile>
</activeProfiles>

(3)配置eclipse
Window > Preferences > Maven and checking the “Download Artifact
Sources” and “Download Artifact JavaDoc” options

yzc579亚洲城官网 5

Setting the -source and -target of the Java Compiler

Sometimes when you may need to compile a certain project to a different
version than what you are currently using. The javac can accept such
command using -source and -target. The Compiler Plugin can also be
configured to provide these options during compilation.

For example, if you want to enable assertions (-source 1.4) and also
want the compiled classes to be compatible with JVM 1.4 (-target 1.4),
you can then put:

<project>
  [...]
  <build>
    [...]
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.2</version>
        <configuration>
          <source>1.4</source>
          <target>1.4</target>
        </configuration>
      </plugin>
    </plugins>
    [...]
  </build>
  [...]
</project>

 

 

yzc579亚洲城官网,Maven Compiler Plugin

The Compiler Plugin is used to compile the sources of your project.
Since 3.0, the default compiler is javax.tools.JavaCompiler (if you are
using java 1.6) and is used to compile Java sources. If you want to
force the plugin using javac, you must configure the plugin
option forceJavacCompilerUse.

Also note that at present the default source setting is 1.5 and the
default target setting is 1.5, independently of the JDK you run
Maven with. If you want to change these defaults, you should
set source and target as described in Setting the -source and
-target of the Java
Compiler.

Other compilers than javac can be used and work has already started on
AspectJ, .NET, and C#.

This Compiler Plugin corresponds to Maven 1.x’s Java Plugin.

 

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.2:compile
(default-compile) on project rruHotloadFileMaker: Compilation failure
[ERROR] No compiler
is provided in this environment. Perhaps you are running on a JRE rather
than a JDK?

[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]

yzc579亚洲城官网 6

  1. 在eclipse的美食指南中,进入 Window > Preferences > Java >
    Installed JREs > Execution Environments,选取JavaSE-1.6,
    在右臂采用jdk.

  2. 下一场在maven菜单中使用 “update project …(刷新maven配置)

使用JDK1.8安装后,会在Win10
path中新增 C:\ProgramData\Oracle\Java\javapath
诸如此类也会导致出现“No compiler is provided in this environment. Perhaps
you are running on a JRE rather than a JDK?”

缓慢解决的方法是把“C:\ProgramData\Oracle\Java\javapath”从path中除去,再把java.exe所在路线增加到path中

 

在其余电话上开创3个maven工程,复制到本机上导入,出现pom.xml文件漏洞百出,提醒错误如下
Multiple annotations found at this line:

  • Execution default-testResources of goal
    org.apache.maven.plugins:maven-resources-         
    plugin:2.4.3:testResources failed:
     Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of
    its dependencies could not be resolved: Failed to collect
     dependencies for
    org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 ()

错误音讯出现在pom头的project标签,project标签内容是 <project
xmlns=””
xmlns:xsi=””
 xsi:schemaLocation=”
;

缘由
那是出于缺少maven-resources-plugin-二.四.三.jar文件。那一个文件是在{user.home}\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\下。{user.home}是maven的布局路径,一般是自己的文书档案,是window-preferences-MyEclipse-Maven四MyEclipse-User
Setting里面包车型客车Local Repository。

杀鸡取蛋方案 一、在pom.xml文件中插手maven-resources-plugin配置

<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.4.3</version>
</dependency>

2、在命令行下运营mvn install,
假使奉行科学应该会在{user.home}\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\下看到maven-resources-plugin-2.4.3.jar文件
3、刷新工程(右键工程选拔刷新项)
4、刷新maven配置,右键工程节点,选取Maven-Update
Project Configuration

 

用eclipse装m二eclipse的时候装完后创制项指标时候报错:
Could not resolve archetype
org.apache.maven.archetypes:maven-archetype-quickstart
:RELEASE
from any of the configured repositories.
斩草除根办法:
1.从 
下载最新版maven-archetype-quickstart-壹.1.jar
2.命令行到下载目录下执行mvn install:install-file
-DgroupId=org.apache.maven.archetypes
-DartifactId=maven-archetype-quickstart -Dversion=壹.一 -Dpackaging=jar
-Dfile=maven-archetype-quickstart-1.一.jar

在install
maven-archetype-j二ee-simple-1.0-阿尔法-四.jar后,使用命令行或m二eclipse插件均不能够创立archetype为maven-archetype-j贰ee-simple的花色

m2eclipse插件报错:
Unable to create project from archetype
[org.apache.maven.archetypes:maven-archetype-j2ee-simple:RELEASE]
Error merging velocity templates

动用mvn archetype:generate后的报错消息:

[WARNING] Error reading archetype catalog http://repo.maven.apache.org/maven2
org.apache.maven.archetype.source.ArchetypeDataSourceException: Error parsing a
chetype catalog.
        at org.apache.maven.archetype.source.CatalogArchetypeDataSource.readCat
log(CatalogArchetypeDataSource.java:194)
        at org.apache.maven.archetype.source.RemoteCatalogArchetypeDataSource.d
wnloadCatalog(RemoteCatalogArchetypeDataSource.java:121)
        at org.apache.maven.archetype.source.RemoteCatalogArchetypeDataSource.g
tArchetypeCatalog(RemoteCatalogArchetypeDataSource.java:87)
        at org.apache.maven.archetype.DefaultArchetypeManager.getRemoteCatalog(
efaultArchetypeManager.java:216)
        at org.apache.maven.archetype.DefaultArchetypeManager.getRemoteCatalog(
efaultArchetypeManager.java:205)
        at org.apache.maven.archetype.ui.generation.DefaultArchetypeSelector.ge
ArchetypesByCatalog(DefaultArchetypeSelector.java:200)
        at org.apache.maven.archetype.ui.generation.DefaultArchetypeSelector.se
ectArchetype(DefaultArchetypeSelector.java:71)
        at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.exec
te(CreateProjectFromArchetypeMojo.java:181)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Defaul
BuildPluginManager.java:132)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
.java:208)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProj
ct(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProj
ct(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThr
adedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecyc
eStarter.java:120)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Lau
cher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.ja
a:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(L
uncher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java
356)
Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: Expected r
ot element 'archetype-catalog' but found 'html' (position: START_TAG seen <html
... @1:6)
        at org.apache.maven.archetype.catalog.io.xpp3.ArchetypeCatalogXpp3Reade
.read(ArchetypeCatalogXpp3Reader.java:737)
        at org.apache.maven.archetype.catalog.io.xpp3.ArchetypeCatalogXpp3Reade
.read(ArchetypeCatalogXpp3Reader.java:554)
        at org.apache.maven.archetype.catalog.io.xpp3.ArchetypeCatalogXpp3Reade
.read(ArchetypeCatalogXpp3Reader.java:568)
        at org.apache.maven.archetype.source.CatalogArchetypeDataSource.readCat
log(CatalogArchetypeDataSource.java:186)
        ... 28 more
[WARNING] No archetype found in remote catalog. Defaulting to internal catalog
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/m
ven-archetype-j2ee-simple/1.0/maven-archetype-j2ee-simple-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:59 min

 

 

maven打包编写翻译时后台平素输出警告消息
[WARNING] File encoding has not been set, using platform encoding GBK,
i.e. build is platform dependent!
找了半天,原来只要在pom.xml文件中加进3个安顿项就可以
    <properties>
       
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

 

编写翻译(实施命令:mvn install)的时候,又报错

Failed to execute goal on project ui: 
Could not resolve dependencies for project <<package>>:ui:war:1.0: Failed to collect dependencies for [javax.servlet:servlet-api:jar:2.5 (provided), 
org.springframework:spring-core:jar:3.0.5.RELEASE (compile), 
org.springframework:spring-web:jar:3.0.5.RELEASE (compile), 
cglib:cglib:jar:2.2 (compile), org.springframework:spring-aop:jar:3.0.5.RELEASE (compile), 
org.springframework:spring-webmvc:jar:3.0.5.RELEASE (compile), org.springframework:spring-context:jar:3.0.5.RELEASE (compile), 
org.freemarker:freemarker:jar:2.3.18 (compile), gr.imu.ntua.tweetinspire:services:jar:1.0 (compile), 
org.cloudfoundry.samples:tomcat7-standalone:tar.gz:7.0.29 (compile), org.slf4j:slf4j-api:jar:1.6.1 (compile), 
org.slf4j:slf4j-log4j12:jar:1.6.1 (compile), org.slf4j:jcl-over-slf4j:jar:1.6.1 (compile), 
commons-logging:commons-logging:jar:1.1.1 (compile), junit:junit:jar:4.8.1 (test), 
org.springframework:spring-test:jar:3.0.5.RELEASE (test), org.dbunit:dbunit:jar:2.4.8 (test)]: Failed to read artifact descriptor for org.cloudfoundry.samples:tomcat7-standalone:tar.gz:7.0.29: Could not transfer artifact org.cloudfoundry.samples:tomcat7-standalone:pom:7.0.29 from/to jets3t (http://www.jets3t.org/maven2): Access denied to: http://www.jets3t.org/maven2/org/cloudfoundry/samples/tomcat7-standalone/7.0.29/tomcat7-standalone-7.0.29.pom, ReasonPhrase:Forbidden

焚林而猎措施一:

前边就将pom.xml中的一段注重jdk的代码注释掉,

<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>D:\java\jdk\lib\tools.jar </systemPath>
</dependency>

下一场清理Eclipse项目(点击Eclipse编辑器中的Project,
然后点击clean),再将上边这段代码的解说裁撤掉。

化解方法二:
要是上述措施还并未有减轻难题,还是能尝试关闭maven项目在品种运转时自动下载更新仓库选项。操作方法如下:

点击Eclipse中的window菜单,选用Preferences,点击左侧的Maven
,然后去掉Download repository index updates on
startup选项前面的对勾,然后清理Eclipse项目(Project–>clean)。
yzc579亚洲城官网 7

使用maven创制web工程,将Spring配置文件applicationContext.xml放在src/resource下,用eclipse编写翻译时提示class
path resource [applicationContext.xml] cannot be opened because it
does not exist错误。不过用mvn clean package命令编写翻译时成功的。
web.xml配置的如下

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>

用google寻觅一下(在此之前google用持续,用百度搜到蛋疼),开采是出于classpath不是指向resource路径,导致直接找不到文件。必要在classpath前面加个*,那样就减轻难点了。

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext.xml</param-value>
</context-param>

 

 创立Maven项目标操作步骤:
一、一般用 Eclipse 建项目标手续如下:
(1)建一个普普通通品种
(二)建 pom.xml,定义好构件
(叁)项目右键菜单,Configure -> Convert to Maven Project
(四)注意那么些目录和文件不要进入版本调控:.settings, target, .classpath,
.project

2、

 

java.lang.NoClassDefFoundError:
org/junit/runners/model/MultipleFailureException
 at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.withAfterClasses(SpringJUnit4ClassRunner.java:188)
 at org.junit.runners.ParentRunner.classBlock(ParentRunner.java:145)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:235)

 

Author

发表评论

电子邮件地址不会被公开。 必填项已用*标注