I'm trying to write a simple Bamboo spec which will check out source code from a CVS repository. A slightly modified version of the plan I'm trying to create as a starter is shown below
Plan createPlan()
{
Plan plan = new Plan(new Project().name("Spec Testing").key("SPEC"), "Spec Plan", "PLAN")
.description("Plan generated from spec");
AtlassianModule atlassianModuleCvs = new AtlassianModule("com.atlassian.bamboo.plugin.system.repository:cvs");
Map<String,Object> cvsConf = new HashMap<String,Object>();
cvsConf.put("cvsRoot", "/");
cvsConf.put("authType", "password");
cvsConf.put("password", "password123");
cvsConf.put("quietPeriod", 2);
cvsConf.put("module", "sw");
cvsConf.put("selectedVersionType", "branch");
cvsConf.put("branchName", "REL-1-0");
Map <String,Object> srvConf = new HashMap<String,Object>();
srvConf.put("repository.cvs", cvsConf);
plan.planRepositories(new AnyVcsRepository(atlassianModuleCvs)
.name("CVS Repository")
.serverConfiguration(srvConf));
return plan;
}
When I run the spec initially, everything seems fine until I try to access the plan in Bamboo, at which point I get an internal server error with a NullPointerException. The full stack trace is here, but I think the key parts are the following lines where it tries to read the plan repository definition:
io.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:156)
at io.atlassian.util.concurrent.LazyReference.get(LazyReference.java:116)
at com.atlassian.bamboo.plan.cache.AbstractImmutableChain.getPlanRepositoryDefinitions(AbstractImmutableChain.java:231)
at com.atlassian.bamboo.plan.PlanHelper.getPlanRepositoryDefinitions(PlanHelper.java:49)
at com.atlassian.bamboo.plan.PlanHelper.getDefaultPlanRepositoryDefinition(PlanHelper.java:69)
at com.atlassian.bamboo.plan.branch.ChainBranchUtils.getANameFromBranch(ChainBranchUtils.java:64)
at com.atlassian.bamboo.plan.branch.ChainBranchUtils.getSubstitutedVcsBranchDisplayNameWithoutContextChange(ChainBranchUtils.java:51)
at com.atlassian.bamboo.plan.branch.ChainBranchUtils.getChainBranchNameWithoutContextChange(ChainBranchUtils.java:110)
at com.atlassian.bamboo.plan.branch.ChainBranchUtils.lambda$getChainBranchNameInTemporaryContext$3(ChainBranchUtils.java:101)
at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:196)
at com.atlassian.bamboo.plan.branch.ChainBranchUtils.getChainBranchNameInTemporaryContext(ChainBranchUtils.java:100)
at com.atlassian.bamboo.plan.branch.ChainBranchUtils.getChainBranchName(ChainBranchUtils.java:95)
at com.atlassian.bamboo.ww2.beans.DecoratedNavObjectFactoryImpl.getSubstitutedBranchName(DecoratedNavObjectFactoryImpl.java:132)
...
Am I doing something wrong here? I know we should really move away from CVS, but that's not something we can easily do right now. I'm using Bamboo 6.1.1.