Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46765

Cannot include kubernetes plugin as Maven dependency

      I'm trying to develop a new plugin, kubernetes secrets provider for the credentials plugin, which has a dependency on the kubernetes plugin (for ServiceAccountCredential), however, when including the kubernetes plugin into Maven I cannot build the plugin anymore. As soon as it's removed it works fine.

          <dependency>
            <groupId>org.csanchez.jenkins.plugins</groupId>
            <artifactId>kubernetes</artifactId>
            <version>1.0</version>
          </dependency>
      

      Produces the following error when doing

      $ mvn hpi:run
      [INFO] Scanning for projects...
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Building TODO Plugin 1.0-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO]
      [INFO] >>> maven-hpi-plugin:1.117:run (default-cli) > compile @ kubernetes-secrets >>>
      [INFO]
      [INFO] --- maven-hpi-plugin:1.117:validate (default-validate) @ kubernetes-secrets ---
      [INFO]
      [INFO] --- maven-enforcer-plugin:1.3.1:display-info (display-info) @ kubernetes-secrets ---
      [INFO] Maven Version: 3.3.9
      [INFO] JDK Version: 1.8.0_121 normalized as: 1.8.0-121
      [INFO] OS Info: Arch: x86_64 Family: mac Name: mac os x Version: 10.12.6
      [INFO]
      [INFO] --- maven-enforcer-plugin:1.3.1:enforce (display-info) @ kubernetes-secrets ---
      [INFO] Restricted to JDK 1.7 yet org.csanchez.jenkins.plugins:kubernetes:jar:1.0:compile contains org/csanchez/jenkins/plugins/kubernetes/ContainerEnvVar$DescriptorImpl.class targeted to JDK 1.8
      [WARNING] Rule 2: org.apache.maven.plugins.enforcer.EnforceBytecodeVersion failed with message:
      Found Banned Dependency: org.csanchez.jenkins.plugins:kubernetes:jar:1.0
      Use 'mvn dependency:tree' to locate the source of the banned dependencies.
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 4.116 s
      [INFO] Finished at: 2017-09-08T18:56:28+01:00
      [INFO] Final Memory: 63M/1038M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (display-info) on project kubernetes-secrets: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [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
      

          [JENKINS-46765] Cannot include kubernetes plugin as Maven dependency

          Just switch your maven build to Java 8

          Carlos Sanchez added a comment - Just switch your maven build to Java 8

          Hosh added a comment - - edited

          I had my maven build set to 8, however I wasn't aware of java.level option. I had to set that to 8 too. Thanks!

          Hosh added a comment - - edited I had my maven build set to 8, however I wasn't aware of java.level option. I had to set that to 8 too. Thanks!

          Are you making the plug-in open source?
          I thought about doing the same thing for credentials

          Carlos Sanchez added a comment - Are you making the plug-in open source? I thought about doing the same thing for credentials

          Hosh added a comment -

          I am! I've just pushed a basic POC that I have been working on over the past few days if you're interested: https://github.com/hoshsadiq/jenkins-kubernetes-secrets-credentials.

          Happy to hear some feedback, as I've never written a Jenkins plugin before

          Hosh added a comment - I am! I've just pushed a basic POC that I have been working on over the past few days if you're interested: https://github.com/hoshsadiq/jenkins-kubernetes-secrets-credentials . Happy to hear some feedback, as I've never written a Jenkins plugin before

            csanchez Carlos Sanchez
            thehosh Hosh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: