Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to add libraries using a POM as a dependency doesn't work #187

Open
Ardesco opened this Issue Jul 27, 2016 · 4 comments

Comments

2 participants
@Ardesco
Copy link
Contributor

Ardesco commented Jul 27, 2016

Looks like using a POM as a dependency is just downloading the POM and sticking it in the lib directory.

@Ardesco Ardesco added the bugs label Jul 27, 2016

@Ardesco Ardesco added this to the 2.1.0 milestone Jul 27, 2016

@pmouawad pmouawad modified the milestones: 2.2.0, 2.3.0 May 1, 2017

@pmouawad pmouawad modified the milestones: 2.3.0, 2.4.0 Oct 10, 2017

@pmouawad

This comment has been minimized.

Copy link
Contributor

pmouawad commented Nov 12, 2017

Hi @Ardesco ,
Can you clarify this issue with some example ?
Thank you

@Ardesco

This comment has been minimized.

Copy link
Contributor Author

Ardesco commented Nov 13, 2017

Maven allows you to create POM files that provide a list of dependencies you want to use in your projects, it would probably be most useful when dealing with things like jmeter-plugins that has transitive dependency errors:

<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.something</groupId>
    <artifactId>plugin-deps</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>

    <dependencies>
        <dependency>
            <groupId>kg.apc</groupId>
            <artifactId>jmeter-plugins</artifactId>
            <version>1.3.1</version>
            <exclusions>
                <exclusion>
                    <artifactId>commons-math3</artifactId>
                    <groupId>commons-math3</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>commons-pool2</artifactId>
                    <groupId>commons-pool2</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
            <version>2.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-math3</artifactId>
            <version>3.4.1</version>
        </dependency>
    </dependencies>
</project>

We should then be able to reference this POM file in the plugin as a dependency:

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmeter</groupId>
                    <artifactId>jmeter-maven-plugin</artifactId>
                    <version>USE LAST VERSION</version>
                    <executions>
                        <execution>
                            <id>jmeter-tests</id>
                            <goals>
                                <goal>jmeter</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <jmeterExtensions>
                            <artifact>com.something:plugins-deps:1.0.0:pom</artifact>
                        </jmeterExtensions>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    [...]
</project>
+---+

It should then pull down the libraries specified in the POM at the top of this post and deal with the explicit exclusions.

@pmouawad

This comment has been minimized.

Copy link
Contributor

pmouawad commented Jan 21, 2018

Hi @Ardesco ,
Shouldn't it be:

             <jmeterExtensions>
                            <artifact>com.something:plugins-deps:pom:1.0.0</artifact>
              </jmeterExtensions>
@Ardesco

This comment has been minimized.

Copy link
Contributor Author

Ardesco commented Jan 22, 2018

Quite possibly, it's been a long time since I looked at this.

@pmouawad pmouawad added the help wanted label Feb 1, 2018

@pmouawad pmouawad added this to the 2.8.0 milestone Feb 11, 2018

@pmouawad pmouawad added this to Low priority in ISSUE TRACKING Aug 3, 2018

@pmouawad pmouawad modified the milestones: 2.8.0, 2.9.0 Oct 4, 2018

@pmouawad pmouawad modified the milestones: 2.8.1, 2.8.2 Nov 11, 2018

@pmouawad pmouawad modified the milestones: 2.8.2, 2.8.3 Dec 27, 2018

@pmouawad pmouawad modified the milestones: 2.8.3, 2.8.4 Jan 15, 2019

@pmouawad pmouawad modified the milestones: 2.8.4, 2.8.5 Jan 29, 2019

@pmouawad pmouawad modified the milestones: 2.8.6, 2.8.7 Feb 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.