Reputation: 3581
I have a jenkins instance with the latest artifactory plugin installed. I also have the source code for artifactory and I have modified to a my new use. As I want to test it, I want it to coexist with the original artifactory plugin so that I can compare both side by side. I have changed the name spaces in the UI so they don't conflict.
Problem - When I try and upload the my plugin, it overrides the original artifactory plugin somehow figuring it to be the same plugin. I went ahead and changed the artifact name/project name in pom.xml in my plugin to be different, but now it gives me error - "attempt to register a second Permission for ..."
This can be traced to jenkins source code here -- https://github.com/jenkinsci/jenkins/blob/81701326a0ad2f07862bb034f9fb08be52f95608/core/src/main/java/hudson/security/PermissionGroup.java
Any pointers in how to make it possible ?
Upvotes: 1
Views: 503
Reputation: 111555
That error occurs because both plugins are defining the same permission group in the ArtifactoryPlugin
class.
But even if you resolve that, I would be surprised if Jenkins manages to successfully load both plugins due to them both having the same Java package name. Even if they do load, you'll have other conflicts when trying to load or configure jobs due to this clash. If you then fix that, you then may run into classloading issues due to both plugins having the same dependencies.
If you want to test both versions at the same time, I would run two separate Jenkins instances.
e.g. your development version as normal per mvn hpi:run
and the other via java -jar jenkins.war --httpPort=8081
.
Upvotes: 1