Forum Discussion
terrip
13 years agoNew Contributor
FWIW, I see the same behavior when executing from ant. For reasons other than just this one, I downloaded a nightly snapshot build, including the source code. There's nothing like the source code! I opened up the GroovyUtils.java class in a text editor and found this:
Notice the line
So, it turns out that you *have* to specify the project file name using a platform-specific separator character, even if you are using ant/maven. I was sending this: ../projects/<projectFileName>.xml When I changed it to this: ..\\projects\\<projectFileName>.xml, all worked as it should have.
public final String getProjectPath()
{
Project project = ModelSupport.getModelItemProject( context.getModelItem() );
String path = project.getPath();
int ix = path.lastIndexOf( File.separatorChar );
return ix == -1 ? "" : path.substring( 0, ix );
}
Notice the line
int ix = path.lastIndexOf( File.separatorChar );
So, it turns out that you *have* to specify the project file name using a platform-specific separator character, even if you are using ant/maven. I was sending this: ../projects/<projectFileName>.xml When I changed it to this: ..\\projects\\<projectFileName>.xml, all worked as it should have.