Unable to test Jenkins plugin

后端 未结 2 1725
萌比男神i
萌比男神i 2021-01-19 10:58

I am actually trying to develop a Jenkins plugin using maven but I am unable to test it.

I created my project with the command mvn -cpu hpi:create. I c

2条回答
  •  灰色年华
    2021-01-19 11:33

    In pom.xml, try changing parent to this:

    
        org.jenkins-ci.plugins
        plugin
        1.454
    
    

    I just did quick test with that hpi:create, and it worked for me, I got both global and job config things as expected, but I had to do that change to pom.xml, before I got it to compile.

    That is, I did:

    • mvn hpi:create
    • entered groupId foo.hyde.jenkins.plugins, artifactId hello-world when prompted.
    • cd hello-world
    • mvn install failed
    • Edit pom.xml to change the parent
    • mvn install succeeded
    • mvn hpi:run -Djetty.port=8092 succeeded (Using that port because other Jenkins is already in default port, otherwise -D... not needed.)
    • Go to http://localhost:8092, check global config, create job and add the build step

    And it worked for me.

    I'm using Maven 2, version 2.2.1.

提交回复
热议问题