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

Remote API to createItem configuration inconsistant

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • sonar-plugin
    • None
    • Hudson v1.395, Tomcat 6.0.26

      When using http://hudson/createItem and posting a config.xml file to the url, the job is created however the defaultGoals for Maven does not appear on the 'Configure'. But when I view http://hudson/job/xx/config.xml the defautGoals is what was set in the config.xml when it was posted to the api.

      When built it ignores the defaultGoal in the config.xml and takes the blank entry from the Configuration.

      Tested this with Maven 2.2.1 and Maven 3.0.2 with same result.

          [JENKINS-8821] Remote API to createItem configuration inconsistant

          evernat added a comment -

          In config.xml of a Maven job, I see "goals" but not "defaultGoal".
          Are you sure that this a defect?
          And is this still a problem for you?

          evernat added a comment - In config.xml of a Maven job, I see "goals" but not "defaultGoal". Are you sure that this a defect? And is this still a problem for you?

          evernat added a comment -

          No response from the reporter, so resolving as incomplete.

          evernat added a comment - No response from the reporter, so resolving as incomplete.

          Luis Silva added a comment - - edited

          This problem is happening to me as well.
          I have a working jenkins job, which gets code from git and execute sonar-scanner in the downloaded code.
          I got the config.xml from the working job and I created a new job using the same config.xml, but just changing the it's name.
          The new Job is created with sucess, however the build step to run sonar is not there, but if I look in the new job config.xml it is correct, if I ran the job, the sonar part does't ran.

          I did a test with another build step only to run a command line (ls -la) and creating a new job works fine, so perhaps it is something related to the sonar plugin ????

          This is my config.xml:

          <?xml version='1.0' encoding='UTF-8'?>
          <project>
          <actions/>
          <description></description>
          <keepDependencies>false</keepDependencies>
          <properties/>
          <scm class="hudson.plugins.git.GitSCM" plugin="git@2.4.4">
          <configVersion>2</configVersion>
          <userRemoteConfigs>
          <hudson.plugins.git.UserRemoteConfig>
          <url>https://github.com/SonarSource/sonar-examples.git</url>
          <credentialsId>REMOVED</credentialsId>
          </hudson.plugins.git.UserRemoteConfig>
          </userRemoteConfigs>
          <branches>
          <hudson.plugins.git.BranchSpec>
          <name>*/master</name>
          </hudson.plugins.git.BranchSpec>
          </branches>
          <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
          <submoduleCfg class="list"/>
          <extensions/>
          </scm>
          <canRoam>true</canRoam>
          <disabled>false</disabled>
          <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
          <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
          <triggers/>
          <concurrentBuild>false</concurrentBuild>
          <builders>
          <hudson.plugins.sonar.SonarRunnerBuilder plugin="sonar@2.4">
          <project></project>
          <properties>sonar.projectKey=org.sonarqube:javascript-simple-sq-scanner
          sonar.projectName=JavaScript :: Simple Project :: SonarQube Scanner
          sonar.projectBaseDir=./projects/languages/javascript/javascript-sonar-runner
          sonar.projectVersion=1.0
          sonar.sources=src
          sonar.language=js</properties>
          <javaOpts></javaOpts>
          <additionalArguments>-X</additionalArguments>
          <jdk>(Inherit From Job)</jdk>
          <task></task>
          </hudson.plugins.sonar.SonarRunnerBuilder>
          </builders>
          <publishers/>
          <buildWrappers/>
          </project>

          this is command to create a job using webapi:
          curl -s --data-binary @config.xml -H "Content-Type: application/xml" -X POST http://localhost:8080/createItem?name=NEWITEM

          Luis Silva added a comment - - edited This problem is happening to me as well. I have a working jenkins job, which gets code from git and execute sonar-scanner in the downloaded code. I got the config.xml from the working job and I created a new job using the same config.xml, but just changing the it's name. The new Job is created with sucess, however the build step to run sonar is not there, but if I look in the new job config.xml it is correct, if I ran the job, the sonar part does't ran. I did a test with another build step only to run a command line (ls -la) and creating a new job works fine, so perhaps it is something related to the sonar plugin ???? This is my config.xml: <?xml version='1.0' encoding='UTF-8'?> <project> <actions/> <description></description> <keepDependencies>false</keepDependencies> <properties/> <scm class="hudson.plugins.git.GitSCM" plugin="git@2.4.4"> <configVersion>2</configVersion> <userRemoteConfigs> <hudson.plugins.git.UserRemoteConfig> <url> https://github.com/SonarSource/sonar-examples.git </url> <credentialsId>REMOVED</credentialsId> </hudson.plugins.git.UserRemoteConfig> </userRemoteConfigs> <branches> <hudson.plugins.git.BranchSpec> <name>*/master</name> </hudson.plugins.git.BranchSpec> </branches> <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> <submoduleCfg class="list"/> <extensions/> </scm> <canRoam>true</canRoam> <disabled>false</disabled> <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> <triggers/> <concurrentBuild>false</concurrentBuild> <builders> <hudson.plugins.sonar.SonarRunnerBuilder plugin="sonar@2.4"> <project></project> <properties>sonar.projectKey=org.sonarqube:javascript-simple-sq-scanner sonar.projectName=JavaScript :: Simple Project :: SonarQube Scanner sonar.projectBaseDir=./projects/languages/javascript/javascript-sonar-runner sonar.projectVersion=1.0 sonar.sources=src sonar.language=js</properties> <javaOpts></javaOpts> <additionalArguments>-X</additionalArguments> <jdk>(Inherit From Job)</jdk> <task></task> </hudson.plugins.sonar.SonarRunnerBuilder> </builders> <publishers/> <buildWrappers/> </project> this is command to create a job using webapi: curl -s --data-binary @config.xml -H "Content-Type: application/xml" -X POST http://localhost:8080/createItem?name=NEWITEM

            Unassigned Unassigned
            lukerobertson Luke Robertson
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: