jboss& maven:由于图书馆没有打开,maven构建失败了

时间:2015-04-09 21:11:04

标签: java maven jboss

我正在构建jboss EA 6.3快速入门项目" greeter"。

我在项目目录中运行maven clean install jboss-as:deploy,指示jboss服务器正在运行的whilist。

我收到以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
1:compile (default-compile) on project jboss-greeter: Compilation failure: Compi
lation failure:
[ERROR] error reading C:\Users\boris\.m2\repository\org\jboss\spec\javax\faces\j
boss-jsf-api_2.1_spec\2.1.28.Final-redhat-1\jboss-jsf-api_2.1_spec-2.1.28.Final-
redhat-1.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\hibernate\javax\persiste
nce\hibernate-jpa-2.0-api\1.0.1.Final-redhat-2\hibernate-jpa-2.0-api-1.0.1.Final
-redhat-2.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\jboss\spec\javax\transac
tion\jboss-transaction-api_1.1_spec\1.0.1.Final-redhat-2\jboss-transaction-api_1
.1_spec-1.0.1.Final-redhat-2.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\jboss\spec\javax\ejb\jbo
ss-ejb-api_3.1_spec\1.0.2.Final-redhat-2\jboss-ejb-api_3.1_spec-1.0.2.Final-redh
at-2.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\jboss\spec\javax\faces\j
boss-jsf-api_2.1_spec\2.1.28.Final-redhat-1\jboss-jsf-api_2.1_spec-2.1.28.Final-
redhat-1.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\hibernate\javax\persiste
nce\hibernate-jpa-2.0-api\1.0.1.Final-redhat-2\hibernate-jpa-2.0-api-1.0.1.Final
-redhat-2.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\jboss\spec\javax\transac
tion\jboss-transaction-api_1.1_spec\1.0.1.Final-redhat-2\jboss-transaction-api_1
.1_spec-1.0.1.Final-redhat-2.jar; error in opening zip file
[ERROR] error reading C:\Users\boris\.m2\repository\org\jboss\spec\javax\ejb\jbo
ss-ejb-api_3.1_spec\1.0.2.Final-redhat-2\jboss-ejb-api_3.1_spec-1.0.2.Final-redh
at-2.jar; error in opening zip file
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/Resources.java:[24,27] packag
e javax.faces.context does not exist
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/Resources.java:[44,12] cannot
 find symbol
[ERROR] symbol:   class FacesContext
[ERROR] location: class org.jboss.as.quickstarts.greeter.Resources
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/web/CreateController.java:[21
,31] package javax.faces.application does not exist
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/web/CreateController.java:[22
,27] package javax.faces.context does not exist
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/web/CreateController.java:[34
,13] cannot find symbol
[ERROR] symbol:   class FacesContext
[ERROR] location: class org.jboss.as.quickstarts.greeter.web.CreateController
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/ManagedBeanUserDao.jav
a:[23,25] cannot find symbol
[ERROR] symbol:   class SystemException
[ERROR] location: package javax.transaction
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/ManagedBeanUserDao.jav
a:[24,25] cannot find symbol
[ERROR] symbol:   class UserTransaction
[ERROR] location: package javax.transaction
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/ManagedBeanUserDao.jav
a:[32,13] cannot find symbol
[ERROR] symbol:   class UserTransaction
[ERROR] location: class org.jboss.as.quickstarts.greeter.domain.ManagedBeanUserD
ao
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/EJBUserDao.java:[19,17
] package javax.ejb does not exist
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/EJBUserDao.java:[26,2]
 cannot find symbol
[ERROR] symbol: class Stateful
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/Resources.java:[45,16] cannot
 find symbol
[ERROR] symbol:   variable FacesContext
[ERROR] location: class org.jboss.as.quickstarts.greeter.Resources
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/web/CreateController.java:[48
,47] cannot find symbol
[ERROR] symbol:   class FacesMessage
[ERROR] location: class org.jboss.as.quickstarts.greeter.web.CreateController
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/web/CreateController.java:[51
,47] cannot find symbol
[ERROR] symbol:   class FacesMessage
[ERROR] location: class org.jboss.as.quickstarts.greeter.web.CreateController
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/ManagedBeanUserDao.jav
a:[50,22] cannot find symbol
[ERROR] symbol:   class SystemException
[ERROR] location: class org.jboss.as.quickstarts.greeter.domain.ManagedBeanUserD
ao
[ERROR] /C:/Users/boris/Desktop/JavaLearning/jboss-eap-quickstarts-6.3.0.GA/gree
ter/src/main/java/org/jboss/as/quickstarts/greeter/domain/ManagedBeanUserDao.jav
a:[68,22] cannot find symbol
[ERROR] symbol:   class SystemException
[ERROR] location: class org.jboss.as.quickstarts.greeter.domain.ManagedBeanUserD
ao
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption

我检查了它试图在maven repo中打开的文件。它们都是1kb大,并且不会被winrar打开。 Windows说"文件损坏或损坏"。

其他例子(虽然没有JSF)工作得很好。

2 个答案:

答案 0 :(得分:0)

你的M2_HOME是什么?您可以在M2_HOME / conf / settings.xml中配置路径,例如:

<!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->

答案 1 :(得分:0)

我删除了maven无法打开的指定文件。 Maven重新加载它们,然后它工作得很好。