0

I'm trying to use JMeter maven plugin with private nexus repository without success. Here is the POM file

<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>

I installed all the transitive dependencies in nexus, but the build still tries to connect 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

How do I configure the plugin to use the nexus? Also, it's weird the missing dependency is bcprov-jdk15on:pom:1.59 as cryptacular-1.1.1.pom defines dependency version as 1.54

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
Tuomas Toivonen
  • 21,690
  • 47
  • 129
  • 225

2 Answers2

1

Usually, you define your company Nexus in the settings.xml. Using it as a mirror redirects all requests to it and avoids calls to MavenCentral (which may fail due to proxy/firewall restrictions). A standard example can be found at

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

Note furthermore that the versions of dependencies may be different from the ones defined in (some of the) poms. You can have only one version of a dependency in your dependencies and if you have more than one, Maven will choose one for you, following various rules.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
0

the jmeter-maven-plugin uses aether to resolve and download artifacts.

By default it should pull in all of the project repositories, it looks like adding additional ones via config is broken. I've just raised an issue here: https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/issues/350.

Ardesco
  • 7,281
  • 26
  • 49