我正在尝试将JMeter maven插件与私有Nexus库一起使用,但没有成功。这是POM文件
<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    ...
    <repositories>
        <repository>
             <id>KKV nexus</id>
            <url>http://kkv:8082/nexus/repository/maven-group</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>KKV nexus</id>
            <url>http://kkv:8082/nexus/repository/maven-group</url>
        </pluginRepository>
    </pluginRepositories>
    <build>
        <plugins>
            <plugin>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>2.9.0</version>
                <executions>
                   <!-- Run JMeter tests -->
                   <execution>
                        <id>jmeter-tests</id>
                        <goals>
                            <goal>jmeter</goal>
                        </goals>
                   </execution>
                   <!-- Fail build on errors in test -->
                   <execution>
                        <id>jmeter-check-results</id>
                        <goals>
                            <goal>results</goal>
                        </goals>
                   </execution>
                </executions>
                <configuration>
                    <jmeterExtensions>
                         <artifacts>nz.co.breakpoint:jmeter-wssecurity:1.6</artifacts>
                    </jmeterExtensions>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>我在nexus中安装了所有可传递的依赖项,但是构建仍然尝试连接maven central。
[INFO] --- jmeter-maven-plugin:2.9.0:configure (configure) @ 0-jarj-testi-liittyma ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] C O N F I G U R I N G    J M E T E R
[INFO] -------------------------------------------------------
[INFO]
[INFO] Building JMeter directory structure...
[INFO] Configuring JMeter artifacts...
[INFO] Populating JMeter directory...
[INFO] Copying extensions to JMeter lib/ext directory C:\Projektit\kkv-e2e-testaus\0-jarj-testi-liittyma\target\jmeter\lib\ext with downloadExtensionDependencies set to true...
Downloading from central: https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.59/bcprov-jdk15on-1.59.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10.020 s
[INFO] Finished at: 2019-07-18T13:25:59+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:2.9.0:configure (configure) on project 0-jarj-testi-liittyma: Failed to collect dependencies at org.apache.wss4j:wss4j-ws-security-dom:jar:2.2.2 -> org.apache.wss4j:wss4j-ws-security-common:jar:2.2.2 -> org.opensaml:opensaml-saml-impl:jar:3.3.0 -> org.opensaml:opensaml-saml-api:jar:3.3.0 -> org.opensaml:opensaml-xmlsec-api:jar:3.3.0 -> org.opensaml:opensaml-security-api:jar:3.3.0 -> org.cryptacular:cryptacular:jar:1.1.1 -> org.bouncycastle:bcprov-jdk15on:jar:1.59: Failed to read artifact descriptor for org.bouncycastle:bcprov-jdk15on:jar:1.59: Could not transfer artifact org.bouncycastle:bcprov-jdk15on:pom:1.59 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven.apache.org -> [Help 1]
[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/MojoExecutionException如何配置插件以使用nexus?同样奇怪的是,缺少的依赖项是bcprov-jdk15on:pom:1.59,因为cryptacular-1.1.1.pom将依赖项版本定义为1.54
发布于 2019-07-18 18:56:27
通常,您可以在settings.xml中定义您的公司Nexus。使用它作为镜像可以将所有请求重定向到它,并避免对MavenCentral的调用(由于代理/防火墙限制,这可能会失败)。一个标准的例子可以在
https://github.com/sonatype/nexus-book-examples/blob/master/maven/settings/settings.xml
此外,请注意,依赖项的版本可能与(某些) poms中定义的版本不同。您的依赖项中只能有一个版本的依赖项,如果您有多个版本,Maven将遵循各种规则为您选择一个。
https://stackoverflow.com/questions/57092478
复制相似问题