Home > Mobile >  Trouble importing module for a Jenkins plugin
Trouble importing module for a Jenkins plugin

Time:11-13

I'm trying to modifie an existing plugin for Jenkins and i'm stuck when trying to add new import in Java.

this import in my .java file

import org.jenkinsci.plugins.workflow.job.WorkflowRun;

I have try to add dependency in the pom.xml file.

   <dependencies>
    <dependency>
        <groupId>org.jenkins-ci.plugins</groupId>
        <artifactId>structs</artifactId>
        <version>1.19</version>
    </dependency>
    <dependency>
        <groupId>org.jenkins-ci.plugins.workflow</groupId>
        <artifactId>workflow-step-api</artifactId>
        <version>2.19</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jenkins-ci.plugins.workflow</groupId>
        <artifactId>workflow-cps</artifactId>
        <version>2.56</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jenkins-ci.plugins.workflow</groupId>
        <artifactId>workflow-scm-step</artifactId>
        <version>2.6</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jenkins-ci.plugins.workflow</groupId>
        <artifactId>workflow-job</artifactId>
        <version>2.25</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jenkins-ci.plugins.workflow</groupId>
        <artifactId>workflow-basic-steps</artifactId>
        <version>2.11</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jenkins-ci.plugins.workflow</groupId>
        <artifactId>workflow-durable-task-step</artifactId>
        <version>2.22</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jenkins-ci.plugins.workflow</groupId>
        <artifactId>workflow-api</artifactId>
        <version>2.30</version>
        <scope>test</scope>
    </dependency>
    <!-- <dependency>
        <groupId>org.jenkins-ci.plugins.workflow</groupId>
        <artifactId>scm-api</artifactId>
        <version>2.2.7</version>
        <scope>test</scope>
    </dependency> -->
    <dependency>
        <groupId>org.jenkins-ci.plugins.workflow</groupId>
        <artifactId>workflow-support</artifactId>
        <version>3.3</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jenkins-ci</groupId>
        <artifactId>symbol-annotation</artifactId>
        <version>1.19</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.7</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jenkins-ci.plugins</groupId>
        <artifactId>mailer</artifactId>
        <version>1.20</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jenkins-ci.plugins.workflow</groupId>
        <artifactId>workflow-aggregator</artifactId>
        <version>2.6</version>
        <scope>test</scope>
    </dependency>
</dependencies>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-aggregator</artifactId>
            <version>2.6</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>script-security</artifactId>
            <version>1.46</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>scm-api</artifactId>
            <version>2.2.8</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

and the error is "package org.jenkinsci.plugins.workflow.job does not exist"

The command i use for build:

mvn verify

Can someone help me a bit?

thank you

CodePudding user response:

Add a dependency for workflow-job.

CodePudding user response:

The solution was to remove the test from the dependencies. Thank you

  • Related