Building and running the Broadleaf Commerce demo site

阅读更多
按照 Getting Started的指引,最后运行时还是出现了以下问题:
[artifact:dependencies] Downloading: com/ptp/core/1.0/core-1.0.jar from repository public releases at http://www.broadleafcommerce.org/nexus/content/repositories/snapshots/
[artifact:dependencies] Unable to locate resource in repository
[artifact:dependencies] [INFO] Unable to find resource 'com.ptp:core:jar:1.0' in repository public releases (http://www.broadleafcommerce.org/nexus/content/repositories/snapshots/)
[artifact:dependencies] Downloading: com/ptp/core/1.0/core-1.0.jar from repository central at http://repo1.maven.org/maven2
[artifact:dependencies] Unable to locate resource in repository
[artifact:dependencies] [INFO] Unable to find resource 'com.ptp:core:jar:1.0' in repository central (http://repo1.maven.org/maven2)
[artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
[artifact:dependencies]  Diagnosis:
[artifact:dependencies] 
[artifact:dependencies] Unable to resolve artifact: Missing:
[artifact:dependencies] ----------
[artifact:dependencies] 1) com.ptp:core:jar:1.0
[artifact:dependencies] 
[artifact:dependencies]   Try downloading the file manually from the project website.
[artifact:dependencies] 
[artifact:dependencies]   Then, install it using the command: 
[artifact:dependencies]       mvn install:install-file -DgroupId=com.ptp -DartifactId=core -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file
[artifact:dependencies] 
[artifact:dependencies]   Alternatively, if you host your own repository you can deploy the file there: 
[artifact:dependencies]       mvn deploy:deploy-file -DgroupId=com.ptp -DartifactId=core -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[artifact:dependencies] 
[artifact:dependencies]   Path to dependency: 
[artifact:dependencies]   	1) com.ptp:site:war:1.0
[artifact:dependencies]   	2) com.ptp:core:jar:1.0
[artifact:dependencies] 
[artifact:dependencies] ----------
[artifact:dependencies] 1 required artifact is missing.
[artifact:dependencies] 
[artifact:dependencies] for artifact: 
[artifact:dependencies]   com.ptp:site:war:1.0
[artifact:dependencies] 
[artifact:dependencies] from the specified remote repositories:
[artifact:dependencies]   central (http://repo1.maven.org/maven2),
[artifact:dependencies]   public releases (http://www.broadleafcommerce.org/nexus/content/repositories/snapshots/)


但实际上com.ptp:core:jar已经install到本地仓库了,那么为什么不能找到这个依赖呢?
打开ant的详细日志,即运行时加上-v参数,可以看到:

Using local repository: C:\Users\Administrator\.m2\repository

而我本地使用的库存路径是:F:\MavenRepository\m3\repository
那么问题就找到了,是因为没有使用正确的本地库存,所以在build.xml的加上settingsFile="${maven.home}/conf/settings.xml",问题得到解决。

你可能感兴趣的:(Building and running the Broadleaf Commerce demo site)