In the picture below, I want
- Ivy settings path to NOT include ${ivyproject_loc}
- Property Files to NOT include ${project_loc}
Here is what I have right now. I was thinking it might be easier to remove the ivy library and add it the way I want it. I know how to add, but what is the best way to remove?
protected void changeIvyClasspath(IProject project) throws CoreException {
if(project.hasNature(JavaCore.NATURE_ID)){
IJavaProject jproject = JavaCore.create(project);
IClasspathEntry[] entries = jproject.getRawClasspath();
for (IClasspathEntry entry : entries) {
if(entry.toString().contains("org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER")){
if(entry.toString().contains("project_loc") || entry.toString().contains("ivyproject_loc")){
//how to remove entry?
addIvyToClasspath();
}
}
}
}
}
Something else I have tried is to modify the existing settings, but it did not work.
Here is the code that attempted to do that:
protected void changeIvyClasspath(IProject project) throws CoreException {
if(project.hasNature(JavaCore.NATURE_ID)){
IJavaProject jproject = JavaCore.create(project);
IClasspathEntry[] entries = jproject.getRawClasspath();
for (IClasspathEntry entry : entries) {
if(entry.toString().contains("org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER")){
if(entry.toString().contains("project_loc") || entry.toString().contains("ivyproject_loc")){
IvyClasspathContainer ivycp = IvyClasspathContainerHelper.getContainer(entry.getPath(), jproject);
IvyClasspathContainerConfiguration conf = new IvyClasspathContainerConfiguration(jproject, "ivy.xml", true);
SettingsSetup ss = conf.getIvySettingsSetup();
List<String> props = new ArrayList<String>();
props.add("project.properties");
props.add(".properties/eclipse.properties");
ss.setPropertyFiles(props);
conf.setIvySettingsSetup(ss);
ss.setIvySettingsPath(".properties/ivysettings.xml");
ivycp.setConf(conf);
ivycp.launchResolve(false, null);
}
}
}
}
}
With the project, you can get all the class path entries. I went through and excludes the ivy entries. Then I re-added them with the correct class path and property files. Now, the paths do not include ${ivyproject_loc} and ${project_loc}.
Here is the code: