当我运行mvn clean
或mvn clean install
或mvn eclipse:eclipse
等任何maven命令时,我收到以下错误。
但我可以在我的系统中运行除此之外的任何其他maven项目,因此我确信它与路径问题或代理无关。
以下是我的错误
1. [错误]构建无法读取1个项目 - > [帮助1] org.apache.maven.project.ProjectBuildingException:有些问题 在处理POM时遇到:
2. [错误]无法解析的构建扩展:插件com.opencloud.maven.plugins:maven-opencloud-jainslee-plugin:1.1或者一个 其依赖关系无法解决:未能找到 " com.opencloud.maven.plugins:行家-opencloud-jainslee-插件:罐:1.1" in" http://repo.maven.apache.org/maven2"被缓存在当地 存储库,在更新之前不会重新尝试解析 中心间隔已过,或强制更新@
3. [错误]未知包装:"
我使用maven命令生成了sbb文件,
mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=http://developer.opencloud.com/maven2/public
它已成功生成。
但是当使用mvn clean install构建它时,它有以上错误
下面是我的POM.xml
<modelVersion>4.0.0</modelVersion>
<groupId>com.bt</groupId>
<artifactId>myapp-sbb</artifactId>
<packaging>jainslee-sbb-jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>myapp SBB</name>
<dependencies>
<dependency>
<groupId>javax.slee</groupId>
<artifactId>jainslee-api</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>com.opencloud</groupId>
<artifactId>jainslee-base-classes</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.opencloud.maven.plugins</groupId>
<artifactId>maven-opencloud-jainslee-plugin</artifactId>
<extensions>true</extensions>
<version>1.1</version>
<configuration>
<jainsleeVersion>1.1</jainsleeVersion>
<createLibrary>true</createLibrary>
<createDeploymentUnit>true</createDeploymentUnit>
</configuration>
</plugin>
</plugins>
</build>
当我在命令行和eclipse中运行maven clean时,我将得到以下错误
C:\Users\611542579\Documents\NOAS-CSG\Sample\com.bt>mvn clean
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project myApp:com.bt-sbb:1.0-SNAPSHOT
(C:\Users\611542579\Documents\NOAS-CSG\Sample\com.bt\pom.xml) has 2 errors
[ERROR] Unresolveable build extension: Error resolving version for plugin
'com.opencloud.maven.plugins:maven-opencloud-jainslee-plugin'
from the repositories
[local (C:\Users\611542579\.m2\repository),
central (http://repo.maven.apache.org/maven2)]:
Plugin not found in any plugin repository -> [Help 2]
[ERROR] Unknown packaging: jainslee-sbb-jar @ line 7, column 16
[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/PluginVersionResolutionException
答案 0 :(得分:0)
也许你需要在你的pom中使用这样的东西:
<pluginRepositories>
<pluginRepository>
<id>jainslee</id>
<name>Jainslee repos</name>
<url>http://developer.opencloud.com/maven2/public</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
这个
是你在命令行中提供的,但它也在你的pom中吗?
也可能您的本地maven repo存在问题。请尝试以下方法:
在您当地的maven repo中找到相应的路径
{家} /。2 /库/ COM / opencloud /行家/插件/行家-opencloud-jainslee-插件
并删除该目录。再试一次。
更新:在错误消息
上查看此部分[ERROR] Unresolveable build extension: Error resolving version for plugin
'com.opencloud.maven.plugins:maven-opencloud-jainslee-plugin'
from the repositories
[local (C:\Users\611542579\.m2\repository),
central (http://repo.maven.apache.org/maven2)]:
Plugin not found in any plugin repository -> [Help 2]
您可以看到首先从本地搜索插件,然后从中央maven存储库搜索插件。在那里找不到。它应该从这里搜索
这就是为什么你的pom需要<pluginRepositories>
部分。
如果您无法编辑有问题的pom创建虚拟项目,请在该项目中添加此pluginRepository和插件,像mvn install
一样运行:它应该将插件下载到您的本地仓库。
也许那时你可以毫无错误地运行有问题的原创项目。