使用 Maven 构建 JAX-WS 项目

Building JAX-WS project with maven

我尝试构建项目 https://github.com/javaee/metro-jax-ws 但我得到了这些错误:

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Could not find artifact org.glassfish.jaxb:jaxb-bom:pom:2.3.1-b171012.0423 in jvnet-nexus-releases (https://maven.java.net/content/repositories/releases/) @ line 208, column 25
[ERROR] Non-resolvable import POM: Failure to find org.glassfish.jaxb:jaxb-bom:pom:2.3.1-b171012.0423 in https://maven.java.net/content/repositories/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of jvnet-nexus-releases has elapsed or updates are forced @ com.sun.xml.ws:jaxws-ri-bom:2.3.1-SNAPSHOT, /Users/lopes/Downloads/metro-jax-ws-master/jaxws-ri/boms/bom/pom.xml, line 208, column 25
 @ 
[ERROR] The build could not read 2 projects -> [Help 1]
[ERROR]   
[ERROR]   The project com.sun.xml.ws:jaxws-ri-bom:2.3.1-SNAPSHOT (/Users/lopes/Downloads/metro-jax-ws-master/jaxws-ri/boms/bom/pom.xml) has 1 error
[ERROR]     Non-resolvable import POM: Could not find artifact org.glassfish.jaxb:jaxb-bom:pom:2.3.1-b171012.0423 in jvnet-nexus-releases (https://maven.java.net/content/repositories/releases/) @ line 208, column 25 -> [Help 2]
[ERROR]   
[ERROR]   The project com.sun.xml.ws:jaxws-ri-bom-ext:2.3.1-SNAPSHOT (/Users/lopes/Downloads/metro-jax-ws-master/jaxws-ri/boms/bom-ext/pom.xml) has 1 error
[ERROR]     Non-resolvable import POM: Failure to find org.glassfish.jaxb:jaxb-bom:pom:2.3.1-b171012.0423 in https://maven.java.net/content/repositories/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of jvnet-nexus-releases has elapsed or updates are forced @ com.sun.xml.ws:jaxws-ri-bom:2.3.1-SNAPSHOT, /Users/lopes/Downloads/metro-jax-ws-master/jaxws-ri/boms/bom/pom.xml, line 208, column 25 -> [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

先试试:

mvn clean install -U

如果还是不行删除目录

{yourHomeDir}/.m2/repository/org/glassfish/jaxb/jaxb-bom