Creating a Bamboo build plan using the Rest API
Asked by smolkin:

Hi!

I see that task [BAM-4854](https://jira.atlassian.com/browse/BAM-4854) was solved by [release 6.0.0](https://confluence.atlassian.com/display/BAMBOO0600/Bamboo+6.0+Release+Notes). But I couldn't find any new information about plan creation in the REST API [documentation](https://docs.atlassian.com/bamboo/REST/6.0.3/).

When can we start using this feature?


Answers:
author: Alexey Chystoprudov
body: [@smolkin](/t5/user/viewprofilepage/user-id/349009), confirmed this issue and created bug <https://jira.atlassian.com/browse/BAM-18584>


author: Alexey Chystoprudov
body: It's possible to create plan by Bamboo Specs, which uses REST endpoint, that's why that issue was closed. Please look at Bamboo Specs documentation <https://confluence.atlassian.com/bamboo/bamboo-specs-894743906.html>

comments: author: smolkin
body: Unfortunately this solution does not work in windows. When I ran

```
mvn -Ppublish-specs
```

I got this error:
> \[ERROR\] Failed to execute goal com.atlassian.bamboo:bamboo-specs-runner:6.0.2:run (default-cli) on project bamboo-specs-tutorial: Execution default-cli of goal com.atlassian.bamboo:bamboo-specs-runner:6.0.2:run failed: A required class was missing while executing com.atlassian.bamboo:bamboo-specs-runner:6.0.2:run: tutorial\\PlanSpec (wrong name: tutorial/PlanSpec)

I tried mvn versions 3.2 and 3.5


author: Alexey Chystoprudov
body: can you share your repo if it doesn't have any secrets on Bitbucket/Github? Looks like some issue in folders layout


author: smolkin
body: There are no secrets :) Its just "get started" [tutorial](https://confluence.atlassian.com/bamboo/tutorial-create-a-simple-plan-with-bamboo-specs-894743911.html). I reproduced the error on another PC with the same result

```
mvn archetype:generate -B ^
 -DarchetypeGroupId=com.atlassian.bamboo -DarchetypeArtifactId=bamboo-specs-archetype ^
 -DarchetypeVersion=6.0.2 ^
 -DgroupId=com.atlassian.bamboo -DartifactId=bamboo-specs-tutorial -Dversion=1.0.0-SNAPSHOT ^
 -Dpackage=tutorial -Dtemplate=minimal
cd bamboo-specs-tutorial
mvn -Ppublish-specs -X
```

```
[INFO] Scanning C:\java\proj\bamboo-specs-tutorial\target\classes for classes annotated with Bamboo plan annotation.
[DEBUG] Adding C:\java\proj\bamboo-specs-tutorial\target\classes\tutorial\PlanSpec.class to scan candidates
[DEBUG] Scanning tutorial\PlanSpec for BambooSpec annotation.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.437 s
[INFO] Finished at: 2017-07-21T21:35:56+03:00
[INFO] Final Memory: 19M/272M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.atlassian.bamboo:bamboo-specs-runner:6.0.2:run (default-cli) on project bamboo-specs-tutorial: Execution default-cli of goal com.atlassian.bamboo:bamboo-specs-runner:6.0.2:run failed: A required class was missing while executing com.atlassian.bamboo:bamboo-specs-runner:6.0.2:run: tutorial\PlanSpec (wrong name: tutorial/PlanSpec)
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>com.atlassian.bamboo:bamboo-specs-runner:6.0.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
```

Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T22:39:06+03:00)  
Maven home: c:\\java\\maven\\bin\\..  
Java version: 1.8.0_141, vendor: Oracle Corporation  
Java home: c:\\java\\jdk1.8\\jre  
Default locale: en_US, platform encoding: Cp1251  
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

When I run it from bash all is ok. The difference in trace from bash here:

```
[DEBUG] Scanning tutorial.PlanSpec for BambooSpec annotation.
```

tutorial.PlanSpec - linux

tutorial\\PlanSpec - win

Can this be a problem?


author: Przemek Bruski
body: Until this is fixed, you will need to store your spec file in the default package.


Tags: rest-api