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

Jenkins JIRA | Jeremy Custenborder | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  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 | 2 years 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 | 2 years ago | Jeremy Custenborder
    java.lang.ClassCastException: hudson.model.FreeStyleBuild cannot be cast to hudson.maven.AbstractMavenBuild

    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