运行Windows 8发布预览。我已经为Jboss AS,Seam和Maven设置了相关的路径和变量。但是,当我尝试运行一些示例时,如hotel booking maven无法正常工作。
我的maven版本日志:
Microsoft Windows [Version 6.2.8400]
(c) 2012 Microsoft Corporation. All rights reserved.
C:\Users\Icemilk>mvn --version
Apache Maven 2.2.1 (r801777; 2009-08-07 00:46:01+0530)
Java version: 1.6.0_35
Java home: C:\jdk1.6.0_35\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows nt (unknown)" version: "6.2" arch: "x86" Family: "windows"
C:\Users\Icemilk>
我正在尝试运行Jboss seam酒店预订示例:
D:\Project\7th Semester\jboss-seam-2.3.0.CR1\examples\registration>mvn clean ins
tall
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/jboss/seam/bom/2.3.0.CR1/bom-2.3.
0.CR1.pom
[INFO] Unable to find resource 'org.jboss.seam:bom:pom:2.3.0.CR1' in repository
central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.jboss.seam:bom
Reason: POM 'org.jboss.seam:bom' not found in repository: Unable to download the
artifact from any repository
org.jboss.seam:bom:pom:2.3.0.CR1
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project org.jboss.seam:bom
和我的JBoss环境:
C:\jboss-6.1.0.Final>run.bat
Calling C:\jboss-6.1.0.Final\bin\run.conf.bat
===============================================================================
JBoss Bootstrap Environment
JBOSS_HOME: C:\jboss-6.1.0.Final
JAVA: C:\jdk1.6.0_35\bin\java
JAVA_OPTS: -Dprogram.name=run.bat -Dlogging.configuration=file:"C:\jboss-6.1.0
.Final\bin\logging.properties" -Xms128M -Xmx512M -XX:MaxPermSize=256M -Dsun.rmi.
dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jbos
s.resolver.warning=true -server
CLASSPATH: C:\jdk1.6.0_35\lib\tools.jar;C:\jboss-6.1.0.Final\bin\run.jar
===============================================================================
14:27:05,650 INFO [AbstractJBossASServerBase] Server Configuration:
JBOSS_HOME URL: file:/C:/jboss-6.1.0.Final/
Bootstrap: $JBOSS_HOME\server/default/conf/bootstrap.xml
Common Base: $JBOSS_HOME\common/
Common Library: $JBOSS_HOME\common/lib/
Server Name: default
Server Base: $JBOSS_HOME\server/
Server Library: $JBOSS_HOME\server/default/lib/
Server Config: $JBOSS_HOME\server/default/conf/
Server Home: $JBOSS_HOME\server/default/
Server Data: $JBOSS_HOME\server/default/data/
Server Log: $JBOSS_HOME\server/default/log/
Server Temp: $JBOSS_HOME\server/default/tmp/
14:27:05,666 INFO [AbstractServer] Starting: JBossAS [6.1.0.Final "Neo"]
14:27:12,586 INFO [ServerInfo] Java version: 1.6.0_35,Sun Microsystems Inc.
14:27:12,586 INFO [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (b
uild 1.6.0_35-b10)
14:27:12,586 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 20.10-b01,Su
n Microsystems Inc.
14:27:12,586 INFO [ServerInfo] OS-System: Windows NT (unknown) 6.2,x86
14:27:12,586 INFO [ServerInfo] VM arguments: -Dprogram.name=run.bat -Dlogging.c
onfiguration=file:C:\jboss-6.1.0.Final\bin\logging.properties -Xms128M -Xmx512M
-XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.serve
r.gcInterval=3600000 -Dorg.jboss.resolver.warning=true -Djava.endorsed.dirs=C:\j
boss-6.1.0.Final\lib\endorsed
14:27:12,742 INFO [JMXKernel] Legacy JMX core initialized
我被困住了。我该怎么做才能让这个例子运行?
更新:@ILLA我改为Maven 3,但问题出在那里。
D:\Project\7th Semester\jboss-seam-2.3.0.CR1\examples\registration>mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 14:14:56+0530)
Maven home: C:\apache-maven-3.0.4\bin\..
Java version: 1.6.0_35, vendor: Sun Microsystems Inc.
Java home: C:\jdk1.6.0_35\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows nt (unknown)", version: "6.2", arch: "x86", family: "windows"
D:\Project\7th Semester\jboss-seam-2.3.0.CR1\examples\registration>mvn clean ins
tall
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.jboss.seam.examples-ee6:registration:2.3.0.CR1 (D:\Pro
ject\7th Semester\jboss-seam-2.3.0.CR1\examples\registration\pom.xml) has 1 erro
r
[ERROR] Non-resolvable import POM: Failure to find org.jboss.seam:bom:pom:2.
3.0.CR1 in http://repo.maven.apache.org/maven2 was cached in the local repositor
y, resolution will not be reattempted until the update interval of central has e
lapsed or updates are forced @ org.jboss.seam:examples-ee6:2.3.0.CR1, D:\Project
\7th Semester\jboss-seam-2.3.0.CR1\examples\pom.xml, line 229, column 25 -> [Hel
p 2]
[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/ProjectBuildin
gException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableMo
delException
D:\Project\7th Semester\jboss-seam-2.3.0.CR1\examples\registration>
答案 0 :(得分:8)
Seam Maven依赖项不是由Maven Central 托管,而是由JBoss存储库托管。
也许您忘了在pom.xml中声明repository
。
在那种情况下:
<repositories>
<repository>
<id>JBoss repository</id>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
答案 1 :(得分:0)
此错误表明您正在使用Maven 2.您需要使用Maven 3,因为Maven 2有一个讨厌的依赖性解决错误(discussed in SEAM-10.)
Maven 3与Maven 2完全向后兼容,我们强烈建议您升级。