2

运行 Windows 8 发布预览版。我已经为 Jboss AS、Seam 和 Maven 设置了相关的路径和变量。但是,当我尝试运行一些示例时,例如酒店预订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>
4

2 回答 2

8

Seam Maven 依赖项不是由 Maven Central 托管,而是由 JBoss 存储库托管。
也许您忘记repository在 pom.xml 中声明 a。在这种情况下 :

<repositories>
    <repository>
        <id>JBoss repository</id>
        <url>http://repository.jboss.org/nexus/content/groups/public/</url>
    </repository>
</repositories>

请参阅博客文章:如何在 Maven 中添加远程存储库

于 2012-10-21T01:21:22.883 回答
0

此错误表明,您正在使用 Maven 2。您需要使用 Maven 3,因为 Maven 2 有一个讨厌的依赖关系解析错误(在 SEAM-10 中讨论。

Maven 3 完全向后兼容 Maven 2,我们强烈建议您升级。

于 2012-10-20T09:19:19.050 回答