Running Maven in the first ancestor dir that contains a pom.xml file
Oxygen general issues.
Running Maven in the first ancestor dir that contains a pom.xml file
Hi there,
Our projects are use Maven and are set up such that the xml files are at various depths in a directory tree and there is a pom.xml file in a containing folder. So you might have:
project-name/pom.xml
project-name/src/docbkx/somefile.xml
project-name/src/docbkx/chapters/somechapter.xml
I'd like to set up an External Tool to kick off Maven such that it works even if you're editing somechapter.xml (i.e. a file not in the same dir as pom.xml). I thought I'd write a simple shell script that walks up the tree until it finds a pom file and then runs maven on it:
I figured I could store the script in my framework and have the external tool invoke it from there, but when I try, I always get errors like:
Is there a way to do what I want? I.e. run mvn against the pom even if the pom is in some directory above the currently edited file (and the number of levels up is an arbitrary number)?
Thanks,
David
Our projects are use Maven and are set up such that the xml files are at various depths in a directory tree and there is a pom.xml file in a containing folder. So you might have:
project-name/pom.xml
project-name/src/docbkx/somefile.xml
project-name/src/docbkx/chapters/somechapter.xml
I'd like to set up an External Tool to kick off Maven such that it works even if you're editing somechapter.xml (i.e. a file not in the same dir as pom.xml). I thought I'd write a simple shell script that walks up the tree until it finds a pom file and then runs maven on it:
Code: Select all
while true; do [ -f pom.xml ] && break; cd ..; done; mvn clean generate-sources
Code: Select all
Could not start: Cannot run program "/home/dcramer/.local/share/applications/Oxygen13-2/frameworks/rackbook/test2.sh
" (in directory "/home/dcramer/Documents/rax/rackspace-template/src/docbkx"): java.io.IOException: error=2, No such file or directory
Process ended with exit code: -1234567
Thanks,
David
Re: Running Maven in the first ancestor dir that contains a pom.xml file
Hello,
When you configure the external tool in Oxygen make sure you use "/bin/sh" at the beginning of the "Command line", before the .sh script path.
e.g.
Command line:
Regards,
Adrian
When you configure the external tool in Oxygen make sure you use "/bin/sh" at the beginning of the "Command line", before the .sh script path.
e.g.
Command line:
Code: Select all
/bin/sh /home/dcramer/.local/share/applications/Oxygen13-2/frameworks/rackbook/test2.sh
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service