Author: mculpepper(a)jboss.com
Date: 2007-05-22 13:46:17 -0400 (Tue, 22 May 2007)
New Revision: 2065
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java
Log:
all properties that end with ".dir" are copied into the system and the
classloader
is now setup correctly so the truezip and xerces jars are loaded appropriately
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java
===================================================================
---
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java 2007-05-22
16:58:47 UTC (rev 2064)
+++
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/ant/GenerateArchivesTask.java 2007-05-22
17:46:17 UTC (rev 2065)
@@ -1,5 +1,7 @@
package org.jboss.ide.eclipse.archives.core.ant;
+import java.util.Iterator;
+
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.eclipse.core.runtime.IPath;
@@ -10,13 +12,14 @@
import org.jboss.ide.eclipse.archives.core.StandaloneArchivesCore;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModelCore;
+import org.jboss.ide.eclipse.archives.core.model.internal.xb.XMLBinding;
public class GenerateArchivesTask extends Task {
private String projectPath;
public void init() throws BuildException {
-// Force standalone mode
+ // Force standalone mode
ArchivesCore standalone = new StandaloneArchivesCore();
}
@@ -24,8 +27,23 @@
IPath projectPath = new Path(this.projectPath);
IProgressMonitor monitor = new NullProgressMonitor();
+ for (Iterator iter = getProject().getProperties().keySet().iterator(); iter.hasNext();
)
+ {
+ String property = (String) iter.next();
+ if (property.endsWith(".dir")) {
+ System.setProperty(property, getProject().getProperty(property));
+ }
+ }
+
+ // needed so the correct XML binding / TrueZIP jars are loaded
+ ClassLoader original = Thread.currentThread().getContextClassLoader();
+ ClassLoader myCL = getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(myCL);
+
ArchivesModel.instance().registerProject(projectPath, monitor);
ArchivesModelCore.buildProject(projectPath, monitor);
+
+ Thread.currentThread().setContextClassLoader(original);
}
public String getProjectPath() {