为了在Alfresco上构建Spring Surf项目,我使用了命令:
mvn archetype:generate -DarchetypeCatalog=https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/archetype-catalog.xml
我提供了groupId=surfcmistest
和artifactId=surfcmistest-1.0-SNAPSHOT
。然后,在项目创建的文件夹surfcmistest-1.0-SNAPSHOT
上,我尝试使用Maven进行构建和打包。我跑:
mvn install
我得到了错误:
无法在项目上执行目标surfcmistest-1.0-SNAPSHOT:无法解析项目surfcmistest的依赖项:surfcmistest-1.0-SNAPSHOT:war:1.0-SNAPSHOT:无法在org.springframework.extensions.surf:spring-中收集依赖项surf:jar:5.1-BF-SNAPSHOT:无法读取org.springframework.extensions.surf:spring-surf:jar:5.1-BF-SNAPSHOT的工件描述符:找不到org.alfresco:alfresco-parent:pom:5.1 https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/中的-BF-SNAPSHOT缓存在本地存储库中,在Alfresco-Artifacts的更新间隔过去或强制更新之前,不会重新尝试解析 - > [帮助1]
我的pom.xml是:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>surfcmistest</groupId>
<artifactId>surfcmistest-1.0-SNAPSHOT</artifactId>
<packaging>war</packaging>
<name>sample-app Maven Webapp</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>Alfresco-Artifacts</id>
<name>Alfresco Artifacts SNAPSHOTS</name>
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.extensions.surf</groupId>
<artifactId>spring-surf</artifactId>
<version>5.1-BF-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.extensions.surf</groupId>
<artifactId>spring-surf-api</artifactId>
<version>5.1-BF-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.tuckey</groupId>
<artifactId>urlrewritefilter</artifactId>
<version>4.0.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.2.v20140723</version>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<scanTargets>
<scanTarget>src/main/webapp</scanTarget>
</scanTargets>
</configuration>
</plugin>
</plugins>
</build>
<version>1.0-SNAPSHOT</version>
</project>
我的错误是什么?
答案 0 :(得分:3)
您收到的错误消息是:
在Alfresco-Artifacts的更新间隔过去或强制更新之前,不会重新尝试解析
这是一个非常经典的错误,它通过使用-U
选项运行Maven来解决。
您应该从头开始重启并按照以下步骤操作:
~/.m2/repository
)并删除先前执行maven-archetype-plugin
创建的所有目录。运行命令:
mvn archetype:generate -DarchetypeCatalog=https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/archetype-catalog.xml
org.springframework.extensions.surf:spring-surf-archetype
选项(对我而言,它是选项1但可以更改)。5.1-SNAPSHOT
,这对我来说是选项4(但同样,这可能会改变)Y
确认所有这些属性。进入新创建的目录(它将以您之前选择的artifactId命名)并运行以下Maven命令:
mvn -U clean install