java.lang.ClassCastException: hudson.model.FreeStyleBuild cannot be cast to hudson.maven.AbstractMavenBuild

Jenkins JIRA | Jeremy Custenborder | 1 year ago
  1. 0

    I added a new freestyle build with the first step using the plugin. It's trying to cast to AbstractMavenBuild and is throwing an exception. {code:java} ERROR: Build step failed with exception java.lang.ClassCastException: hudson.model.FreeStyleBuild cannot be cast to hudson.maven.AbstractMavenBuild at org.jenkinsci.plugins.SemanticVersioning.parsing.PomParser.extractAppVersion(PomParser.java:67) at org.jenkinsci.plugins.SemanticVersioning.SemanticVersioningProcesser.getAppVersion(SemanticVersioningProcesser.java:89) at org.jenkinsci.plugins.SemanticVersioning.SemanticVersioningProcesser.determineSemanticVersion(SemanticVersioningProcesser.java:57) at org.jenkinsci.plugins.SemanticVersioning.SemanticVersioningBuilder.perform(SemanticVersioningBuilder.java:106) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:381) Build step 'Determine Semantic Version' marked build as failure {code}

    Jenkins JIRA | 1 year ago | Jeremy Custenborder
    java.lang.ClassCastException: hudson.model.FreeStyleBuild cannot be cast to hudson.maven.AbstractMavenBuild
  2. 0

    I added a new freestyle build with the first step using the plugin. It's trying to cast to AbstractMavenBuild and is throwing an exception. {code:java} ERROR: Build step failed with exception java.lang.ClassCastException: hudson.model.FreeStyleBuild cannot be cast to hudson.maven.AbstractMavenBuild at org.jenkinsci.plugins.SemanticVersioning.parsing.PomParser.extractAppVersion(PomParser.java:67) at org.jenkinsci.plugins.SemanticVersioning.SemanticVersioningProcesser.getAppVersion(SemanticVersioningProcesser.java:89) at org.jenkinsci.plugins.SemanticVersioning.SemanticVersioningProcesser.determineSemanticVersion(SemanticVersioningProcesser.java:57) at org.jenkinsci.plugins.SemanticVersioning.SemanticVersioningBuilder.perform(SemanticVersioningBuilder.java:106) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:381) Build step 'Determine Semantic Version' marked build as failure {code}

    Jenkins JIRA | 1 year ago | Jeremy Custenborder
    java.lang.ClassCastException: hudson.model.FreeStyleBuild cannot be cast to hudson.maven.AbstractMavenBuild
  3. 0
    samebug tip
    When you have no build parameters, uncheck 'This build is parameterized'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      hudson.model.FreeStyleBuild cannot be cast to hudson.maven.AbstractMavenBuild

      at org.jenkinsci.plugins.SemanticVersioning.parsing.PomParser.extractAppVersion()
    2. org.jenkinsci.plugins
      SemanticVersioningBuilder.perform
      1. org.jenkinsci.plugins.SemanticVersioning.parsing.PomParser.extractAppVersion(PomParser.java:67)
      2. org.jenkinsci.plugins.SemanticVersioning.SemanticVersioningProcesser.getAppVersion(SemanticVersioningProcesser.java:89)
      3. org.jenkinsci.plugins.SemanticVersioning.SemanticVersioningProcesser.determineSemanticVersion(SemanticVersioningProcesser.java:57)
      4. org.jenkinsci.plugins.SemanticVersioning.SemanticVersioningBuilder.perform(SemanticVersioningBuilder.java:106)
      4 frames
    3. Hudson
      Executor.run
      1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      3. hudson.model.Build$BuildExecution.build(Build.java:205)
      4. hudson.model.Build$BuildExecution.doRun(Build.java:162)
      5. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
      6. hudson.model.Run.execute(Run.java:1741)
      7. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      8. hudson.model.ResourceController.execute(ResourceController.java:98)
      9. hudson.model.Executor.run(Executor.java:381)
      9 frames