in org.apache.easyant4e/src/org/apache/easyant4e/natures/EasyAntNature.java [103:136]
private void addIvyClasspathContainer() {
/*
IPath projectRelativePath = new Path("module.ivy");
IJavaProject javaProject = JavaCore.create(project);
IClasspathEntry newEntry = JavaCore.newContainerEntry(new Path(
IvyClasspathContainer.CONTAINER_ID).append(projectRelativePath).append(confs));
*/
IJavaProject javaProject = JavaCore.create(project);
//Configure project preferences
StringBuffer projectConf = new StringBuffer();
//TODO search *.ivy file
projectConf.append("?ivyXmlPath=module.ivy");
try {
appendConfProp(projectConf, "confs", "*");
appendConfProp(projectConf, "resolveInWorkspace", Boolean.TRUE.toString());
String projectIvySettings = easyantProjectService.getProperty(javaProject.getProject(), "project.ivy.settings.url").getValue();
if(projectIvySettings==null){
projectIvySettings = easyantProjectService.getProperty(javaProject.getProject(), "project.ivy.settings.file").getValue();
if(projectIvySettings!=null){
projectIvySettings = "file://"+resolveRelativePath(projectIvySettings);
}
}
if(projectIvySettings!=null){
appendConfProp(projectConf, "ivySettingsPath", projectIvySettings);
}
} catch (UnsupportedEncodingException e) {
Activator.getEasyAntPlugin().log(IStatus.ERROR, e.getMessage(), e);
}
// add the classpath entry
IPath path = new Path(IvyClasspathContainer.ID).append(projectConf.toString());
IClasspathEntry newEntry = JavaCore.newContainerEntry(path);
addClassPathEntry(javaProject, newEntry);
}