jmeter-maven-plugin存储库配置

时间:2019-07-18 10:30:19

标签: maven jmeter dependencies jmeter-maven-plugin

我正在尝试将JMeter maven插件与私有关系存储库一起使用而没有成功。这是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

如何配置插件以使用关系?另外,很奇怪,缺少的依赖项是bcprov-jdk15on:pom:1.59,因为cryptacular-1.1.1.pom将依赖项版本定义为1.54

2 个答案:

答案 0 :(得分:1)

通常,您在settings.xml中定义公司Nexus。将其用作镜像会将所有请求重定向到该请求,并避免调用MavenCentral(由于代理/防火墙限制,此操作可能会失败)。可以在

中找到一个标准示例。

https://github.com/sonatype/nexus-book-examples/blob/master/maven/settings/settings.xml

此外请注意,依赖项的版本可能与poms中(某些)定义的版本不同。您的依赖项中只能有一个版本的依赖项,如果有多个版本,Maven将按照各种规则为您选择一个版本。

答案 1 :(得分:0)

jmeter-maven-plugin使用以太币来解析和下载工件。

默认情况下,它应该拉入所有项目存储库,看起来好像通过config添加其他存储库已损坏。我刚刚在这里提出了一个问题:https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/issues/350