Bamboo Specs Failing With "cannot find symbol"

Tom Thi November 25, 2019

I started with a very simple plan with no jobs or tasks and that worked, but when I added tasks, I'm getting

 

"cannot find symbol" when you try to validate the spec file.

 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project bamboo-specs: Compilation failure: Compilation failure:
[ERROR] /Users/thomasthi/source/adjudicationdocker/bamboo-specs/src/main/java/rxsense/PlanSpec.java:[51,25] cannot find symbol
[ERROR] symbol: class Stage
[ERROR] location: class rxsense.PlanSpec
[ERROR] /Users/thomasthi/source/adjudicationdocker/bamboo-specs/src/main/java/rxsense/PlanSpec.java:[52,39] cannot find symbol
[ERROR] symbol: class Job
[ERROR] location: class rxsense.PlanSpec
[ERROR] /Users/thomasthi/source/adjudicationdocker/bamboo-specs/src/main/java/rxsense/PlanSpec.java:[54,49] cannot find symbol
[ERROR] symbol: class ScriptTask
[ERROR] location: class rxsense.PlanSpec
[ERROR] -> [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/MojoFailureException

 

 

Plan Definition:

This was taken from the tutorial page.

Plan createPlan() { return new Plan(project(), "ContainerBuild", "PLAN") .description("Plan created from Bamboo Java Specs") .stages( new Stage("Stage 1") .jobs(new Job("Run", "RUN") .tasks( new ScriptTask().inlineBody("echo Hello world!")))); }

 

 

 

2 answers

0 votes
Cassius JOHN-ADAMS February 11, 2020

Turns out it's because the required imports aren't being made.

Make sure the src/main/java/tutorial/PlanSpec.java file has the following added.

import com.atlassian.bamboo.specs.api.builders.plan.Job;
import com.atlassian.bamboo.specs.api.builders.plan.Stage;
import com.atlassian.bamboo.specs.builders.task.ScriptTask;

 

Additionally, I had to change the createPlan method to

public Plan createPlan() {

 I believe it was private before and mvn test complained.

0 votes
Cassius JOHN-ADAMS February 11, 2020

I get the same error, straight from the tutorial page.  Haven't figured it out yet.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events