Unable to publish artifact
Asked by Aakash Basnet:

I had define a artifact and make it shared. The build result is successful but I am unable to get artifact.

the definition details is like: Have I missed any thing else that is causing the problem?

Name of artifact Latest War  
If the artifact is shared, the name must be unique within the plan  
Location Target  
Specify the directory (relative path) to find your artifact. e.g. *target*  
Copy pattern \*\*/\*.war  
Shared  
Make the artifact available to be used in other builds and deployments.
If you subscribe to an unavailable shared artifact the build will fail.  
plan-589830-BT-2 (1).log  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/12974/1/plan-589830-BT-2%20(1).log){#display_1172a995a45b49_0}


Answers:
author: rsperafico
body: Hello Aakash,

The best way on helping you would be if you provide the build log with the Script task included in it, so I could have a better understanding to the build you are running and the artifact you are attempting on generate. Since the same wasn't provided, I will suggest you on:

1. please, create a new Plan in Bamboo (i.e.: Artifact)
2. please, add a Script task

   ```
   echo "hello" &gt;&gt; greeting.txt?mkdir fooecho "bar" &gt;&gt; foo/bar.txt
   ```

   Screen Shot 2015-03-16 at 6.14.21 PM.png
3. please, create an Artifact as per following:

   Screen Shot 2015-03-16 at 6.12.57 PM.png

4. run your build  
   Screen Shot 2015-03-16 at 6.15.28 PM.png

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

---

Kind regards,  
Rafael P. Sperafico  
Atlassian Support  
[](https://community.atlassian.com/t5/Bamboo-questions/Unable-to-publish-artifact/qaq-p/412139?attachment-id=4813){#link_1172a99948497b}  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/12977/1/Screen%20Shot%202015-03-16%20at%206.14.21%20PM.png){#display_1172a99948497b_0}  
[](https://community.atlassian.com/t5/Bamboo-questions/Unable-to-publish-artifact/qaq-p/412139?attachment-id=4814){#link_1172a99948497b_0}  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/12977/2/Screen%20Shot%202015-03-16%20at%206.12.57%20PM.png){#display_1172a99948497b_2}  
[](https://community.atlassian.com/t5/Bamboo-questions/Unable-to-publish-artifact/qaq-p/412139?attachment-id=4815){#link_1172a99948497b_1}  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/12977/3/Screen%20Shot%202015-03-16%20at%206.15.28%20PM.png){#display_1172a99948497b_4}

comments: author: Swetha Bammidi
body: how to resolve these issues\>Unable to download artifact Shared artifact: \[WAR artifact\], pattern: \[\*\*/\*.war\] anchored at: \[target\]\>Unable to publish artifact \[WAR artifact\]


author: rsperafico
body: Hello Aakash,

Thank you for your question.

Based on the configuration above, Bamboo will attempt on generating the artifact "Latest War" by trying to find "\*.war" located under your Build Working Directory/Target.

If you open the build log generated from your build, the 2nd line will give you the location to your Build Working Directory. Please, navigate to that location and make sure the ".war" file exists under the location given.

bamboo.buildLog.png

Please, add a new Script task as the latest to be run in your Plan configuration with the following command:

```
# on Linuxls -lR
```

Please, run your build and attach it to this inquire so we can have a better understanding to what you are attempting on doing, please.

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

---

Kind regards,  
Rafael P. Sperafico  
Atlassian Support  
[](https://community.atlassian.com/t5/Bamboo-questions/Unable-to-publish-artifact/qaq-p/412139?attachment-id=12284){#link_1172a9a430d205}  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/12975/1/bamboo.buildLog.png){#display_1172a9a430d205_0}

comments: author: Swetha Bammidi
body: 06-Oct-2015 15:06:22 -rw-r--r-- 1 root root 7427 Oct 6 14:58 stere.js06-Oct-2015 15:06:22 -rw-r--r-- 1 root root 5497 Oct 6 14:58 tmerc.js06-Oct-2015 15:06:22 -rw-r--r-- 1 root root 1488 Oct 6 14:58 utm.js06-Oct-2015 15:06:22 -rw-r--r-- 1 root root 4451 Oct 6 14:58 vandg.js06-Oct-2015 15:06:22 06-Oct-2015 15:06:22 ./otp-analyst-client/src/main/webapp/js/lib/proj4js-1.0.3/lib/util:06-Oct-2015 15:06:22 total 3606-Oct-2015 15:06:22 -rw-r--r-- 1 root root 33476 Oct 6 14:58 MGRS.js06-Oct-2015 15:06:22 06-Oct-2015 15:06:22 ./otp-analyst-client/src/main/webapp/js/otp:06-Oct-2015 15:06:22 total 2006-Oct-2015 15:06:22 -rw-r--r-- 1 root root 13649 Oct 6 14:58 client.js06-Oct-2015 15:06:22 -rw-r--r-- 1 root root 3798 Oct 6 14:58 isochrone.js06-Oct-2015 15:06:22 06-Oct-2015 15:06:22 ./otp-analyst-client/src/main/webapp/META-INF:06-Oct-2015 15:06:22 total 006-Oct-2015 15:06:22 -rw-r--r-- 1 root root 0 Oct 6 14:58 MANIFEST.MF06-Oct-2015 15:06:22 06-Oct-2015 15:06:22 ./otp-analyst-client/src/main/webapp/WEB-INF:06-Oct-2015 15:06:22 total 806-Oct-2015 15:06:22 -rw-r--r-- 1 root root 215 Oct 6 14:58 web.xml06-Oct-2015 15:06:22 -rw-r--r-- 1 root root 518 Oct 6 14:58 wro.xml06-Oct-2015 15:06:22 /home/addteq/bamboo/bamboo-home/artifacts/OTP-DEV/shared/build-00031/WAR-artifact is not a directory06-Oct-2015 15:06:22 Unable to download artifact Shared artifact: \[WAR artifact\], pattern: \[\*\*/\*.war\] anchored at: \[target\]06-Oct-2015 15:06:22 Unable to publish artifact \[WAR artifact\]: the source directory /home/addteq/bamboo/bamboo-home/xml-data/build-dir/OTP-DEV-QADEP/target does not exist.


author: rsperafico
body: Hello Aakash,

I would kindly ask you to accept this answer even though the following has been already accepted so the same will be visible to others who might be facing the same issue you have inquired.

* <https://answers.atlassian.com/questions/13417298>

Thank you for your understanding.

---

Kind regards,  
Rafael P. Sperafico  
Atlassian Support


author: Aakash Basnet
body: Thank you very much Rafael for the prompt response.I could find that war file in the path you mentioned but my question is why it is displaying the message unable to publish the artifact in the build log.

Also inside default job under Artifact section it is not displaying any size of artifact in fact it should display,I guess?.  

Build:[#12](http://bamboo.ntrs.com:8080/browse/GP-GP-12) was successful {#toc-hId-1702823641}
---------------------------------------------------------------------------------------------

* [Build summary](http://bamboo.ntrs.com:8080/browse/GP-GP-12) [Tests](http://bamboo.ntrs.com:8080/browse/GP-GP-12/test) [Commits](http://bamboo.ntrs.com:8080/browse/GP-GP-12/commit) [Artifacts](http://bamboo.ntrs.com:8080/browse/GP-GP-12/artifact) [Logs](http://bamboo.ntrs.com:8080/browse/GP-GP-12/log) [Metadata](http://bamboo.ntrs.com:8080/browse/GP-GP-12/metadata) [Issues](http://bamboo.ntrs.com:8080/browse/GP-GP-12/issues)

Artifacts {#toc-hId--849333320}
-------------------------------

No artifacts have been found for this build result

The build log details is attached herewith for your reference

[](https://community.atlassian.com/t5/Bamboo-questions/Unable-to-publish-artifact/qaq-p/412139?attachment-id=9513){#link_1172a9b2a3c476}  
[](/tnckb94959/attachments/tnckb94959/bamboo-questions/12976/1/build%20log.docx){#display_1172a9b2a3c476_0}