The basedir property is not changed when called from an imported file.
-----------------------------------------------------------------------
Key: MANTRUN-148
URL: http://jira.codehaus.org/browse/MANTRUN-148
Project: Maven 2.x Antrun Plugin
Issue Type: Bug
Environment: Windows XP professional edition
Reporter: Sander Rensen
Attachments: settings.xml, Temp.zip, test-auto-compile.zip
Dear Maven developers,
I want to call an ant script from maven using mojos. The issue I am facing is
that the basedir property does not change the moment this property is used
within an imported file. This needs to happen as the basedir from the imported
file is allocated in a different directory then the directory I am calling the
maven mojo from. Let me explain with an example I have attached.
1. Please first extract the zip file test-auto-compile.zip. Install the mojo
plugin (mvn clean install).
2. Make sure in the maven repository the settings xml file is changed. I have
attached this file separately. I have included a
<pluginGroup>test-auto-compile</pluginGroup> in the settings.xml file.
3. Make sure the files ant-sca-package.xml and ant-sca-compile.xml are copied
in C:/Temp. For this please extract the zip file Temp.zip.
4. run the test-auto-compile project typing: mvn testcompile:testcompile.
5. The error is: Cannot find
D:\SopraGroup\Development\PoC\Mavin\test-auto-compile/ant-sca-compil
e.xml imported from C:\Temp\ant-sca-package.xml.
The file ant-sca-package.xml is imported from the build.xml file. This file
ant-sca-package.xml imports the ant-sca-compile file. This file is imported
using: <import file="${basedir}/ant-sca-compile.xml"/>
The basedir should be the directory from where the ant-sca-package is imported.
In this case c:/Temp. However it tries to find the ant-sca-compile.xml file in
the maven directory as his basedir.
When I am calling the same ant script directly from ant then the basedir
changes and the ant script is completed successfully.
The solution to this issue is very simple by changing the import statement in
the ant-sca-compile file. However I am not aloud to change this file!!
I hope you can assist with this bug.
Many Thanks
Sander Rensen
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira