繁体   English   中英

无法解析的版本扩展:插件com.opencloud.maven.plugins:maven-opencloud-jainslee-plugin:1.1

[英]Unresolvable build extension: Plugin com.opencloud.maven.plugins:maven-opencloud-jainslee-plugin:1.1

当我运行任何maven命令(例如mvn cleanmvn clean installmvn eclipse:eclipse时,出现以下错误。

但是我可以在系统中运行除此以外的任何其他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:maven” “ http://repo.maven.apache.org/maven2 ”中的-opencloud-jainslee-plugin:jar:1.1“已缓存在本地存储库中,直到中心的更新间隔过去或更新到强制@

3. [ERROR]未知包装:”

我使用maven命令mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=http://developer.opencloud.com/maven2/public http://developer.opencloud.com/maven2/public生成了sbb文件,它已成功生成。

但是当使用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

也许您的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>

这个

http://developer.opencloud.com/maven2/public

是您在命令行中提供的内容,但在pom中也是吗?

您的本地Maven存储库可能有问题。 请尝试以下操作:

在本地Maven存储库中找到相应的路径

{home} /。m2 / repositories / com / opencloud / maven / plugins / maven-opencloud-jainslee-plugin

并删除该目录。 再试一次。

更新 :看一下错误消息的这一部分

[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存储库搜索。 在那里找不到。 应该从这里搜索

http://developer.opencloud.com/maven2/public

这就是为什么pom中需要<pluginRepositories>部分的原因。

如果您不能编辑有问题的pom创建虚拟项目,请在该项目中添加这个pluginRepository和plugin,像mvn install一样运行它:它应该将plugin下载到本地仓库中。

这样一来,您就可以毫无问题地运行原始项目。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM