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

cannot build job-dsl-plugin #44

Open
skent opened this issue Jun 17, 2019 · 5 comments
Open

cannot build job-dsl-plugin #44

skent opened this issue Jun 17, 2019 · 5 comments

Comments

@skent
Copy link

skent commented Jun 17, 2019

Getting a build failure when building :FAILURE: Build failed with an exception.

  • Where:
    Build file '/jdsl/job-dsl-plugin/build.gradle' line: 83

  • What went wrong:
    A problem occurred evaluating project ':job-dsl-plugin'.

Could not find method annotationProcessor() for arguments [net.java.sezpoz:sezpoz:1.13] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 53s

@jyanko
Copy link
Contributor

jyanko commented Jan 13, 2020

Decided to try this tool out today, and ran into the same issue with the docker build.

  • appears that gradle v4.6 works, but the v4.4.x that is available from apt no longer works here

Managed to get the build to happen by...

  1. installing curl
  2. use curl to obtain gradle and install from archive (instead of using apt install)

NOTE: I have not yet been able to test functionality, just that the Docker build actually returned successful.

Ran docker build with --no-cache

$ docker build -t jdsl . --no-cache
...
Removing intermediate container e717b1de3cbe
 ---> 3460e8138661
Step 23/23 : CMD ["ruby", "server.rb"]
 ---> Running in 00dc5831984a
Removing intermediate container 00dc5831984a
 ---> 064c779d901b
Successfully built 064c779d901b
Successfully tagged jdsl:latest

@jyanko
Copy link
Contributor

jyanko commented Jan 14, 2020

While I did manage to get the docker build to work, it didn't appear to give me a usable DSL file as output. Not sure if I'm using it wrong, or what at this point.

When I tried running Seed Job ... it fails a the line starting with #(Element:0x2ab401b90dcc

Out of time to troubleshoot on this for now. Maybe revisit later if time presents itself.

# ruby jenkins-xml-to-jobdsl.rb monitor_jenkins_dev.xml
jenkins-xml-to-jobdsl.rb:14: warning: encountered \r in middle of line, treated as a mere space
freeStyleJob('jenkins-xml-to-jobdsl') {
    description('''\

monitor job for jenkins to check/report on HA Proxy up/down

''')
    keepDependencies(false)
    properties {
#(Element:0x2ab401b90dcc {
  name = "hudson.plugins.jira.JiraProjectProperty",
  attributes = [
    #(Attr:0x2ab401b90994 { name = "plugin", value = "[email protected]" })]
  })
...

@visualphoenix
Copy link
Owner

Hi @jyanko. First off, thanks again for looking at jenkins-xml-to-jobdsl. Outputting invalid groovy is known and expected behavior when encountering a node type that is unknown to jenkins-xml-to-jobdsl. To fix this, you would need to figure out how to describe hudson.plugins.jira.JiraProjectProperty with groovy and then add code to handle this property.

@visualphoenix
Copy link
Owner

you likely need to handle this property type in this switch case: https://github.com/visualphoenix/jenkins-xml-to-jobdsl/blob/develop/jenkins-xml-to-jobdsl.rb#L360

@jyanko
Copy link
Contributor

jyanko commented Jan 14, 2020

Thanks @visualphoenix - been a long while since since I've visited this project, and recently had a reason to check it out again.

Assuming the initial docker build failure is related to the fact that Ubuntu latest has changed since back in 2016 (and likely other dependencies).

From your comment above, the "invalid groovy"...

#(Element:0x2ab401b90dcc {
  name = "hudson.plugins.jira.JiraProjectProperty",
  attributes = [
    #(Attr:0x2ab401b90994 { name = "plugin", value = "[email protected]" })]
  })

...in this case effectively a block that the tool currently does not know how to handle. Is the syntax of #(Element... essentially telling me this is literally what was extracted from the XML, but the tool doesn't know what to do with it?

My options appear to be...

  • remove this 'commented' element and try importing the JobDSL
  • find a way to manually write the same in DSL before importing the JobDSL
  • find a way to write the same in DSL, and update the jenkins-xml-to-jobdsl utility to output correctly, then import the JobDSL it creates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants