Author: snjeza
Date: 2012-01-16 18:20:03 -0500 (Mon, 16 Jan 2012)
New Revision: 37883
Modified:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Activator.java
Log:
JBIDE-10638 InvocationTargetException while importing Java EE Project from Central
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/META-INF/MANIFEST.MF
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.project.examples/META-INF/MANIFEST.MF 2012-01-16
22:45:32 UTC (rev 37882)
+++
trunk/maven/plugins/org.jboss.tools.maven.project.examples/META-INF/MANIFEST.MF 2012-01-16
23:20:03 UTC (rev 37883)
@@ -15,7 +15,8 @@
org.eclipse.wst.web.ui;bundle-version="1.1.400",
org.eclipse.ui.forms,
org.jboss.ide.eclipse.as.core;bundle-version="2.3.0",
- org.eclipse.wst.server.core
+ org.eclipse.wst.server.core,
+ org.jboss.tools.maven.ui;bundle-version="1.3.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %Bundle-Vendor
Modified:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java 2012-01-16
22:45:32 UTC (rev 37882)
+++
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenArchetypeProjectExample.java 2012-01-16
23:20:03 UTC (rev 37883)
@@ -47,8 +47,8 @@
final IProgressMonitor monitor) throws Exception {
List<Project> projects = new ArrayList<Project>();
projects.add(projectDescription);
- final IPath location = getLocation();
- final File destination = new File(location.toOSString());
+ //IPath location = getLocation();
+ //final File destination = new File(location.toOSString());
final boolean[] ret = new boolean[1];
ret[0] = true;
@@ -56,7 +56,7 @@
@Override
public void run() {
- ArchetypeExamplesWizard wizard = new ArchetypeExamplesWizard(destination,
projectDescription);
+ ArchetypeExamplesWizard wizard = new ArchetypeExamplesWizard(projectDescription);
WizardDialog wizardDialog = new WizardDialog(getActiveShell(), wizard);
int ok = wizardDialog.open();
if (ok != Window.OK) {
@@ -72,6 +72,7 @@
String projectName = wizard.getProjectName();
includedProjects.add(projectName);
String artifactId = wizard.getArtifactId();
+ IPath location = wizard.getLocationPath();
String projectFolder = location.append(artifactId).toFile()
.getAbsolutePath();
MavenModelManager mavenModelManager = MavenPlugin
Modified:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java 2012-01-16
22:45:32 UTC (rev 37882)
+++
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizard.java 2012-01-16
23:20:03 UTC (rev 37883)
@@ -28,6 +28,7 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.m2e.core.MavenPlugin;
@@ -44,6 +45,7 @@
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkingSet;
import org.jboss.tools.maven.project.examples.MavenProjectExamplesActivator;
+import org.jboss.tools.maven.ui.Activator;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.model.Project;
@@ -61,8 +63,9 @@
protected List<IWorkingSet> workingSets = new ArrayList<IWorkingSet>();
private String projectName;
private String artifactId;
+ private IPath locationPath;
- public ArchetypeExamplesWizard(File location, Project projectDescription) {
+ public ArchetypeExamplesWizard(Project projectDescription) {
super();
setWindowTitle("New JBoss Project");
setDefaultPageImageDescriptor(MavenProjectExamplesActivator.getNewWizardImageDescriptor());
@@ -87,6 +90,7 @@
final String javaPackage = wizardPage.getJavaPackage();
final Properties properties = wizardPage.getProperties();
final Archetype archetype = wizardPage.getArchetype();
+ locationPath = simplePage.getLocationPath();
projectName = configuration.getProjectName(model);
final IProject project =
ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
final IPath location = simplePage.getLocationPath();
@@ -124,7 +128,25 @@
}
};
+ IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ boolean configureSeam = store.getBoolean(Activator.CONFIGURE_SEAM);
+ boolean configureJSF = store.getBoolean(Activator.CONFIGURE_JSF);
+ boolean configurePortlet = store.getBoolean(Activator.CONFIGURE_PORTLET);
+ boolean configureJSFPortlet = store.getBoolean(Activator.CONFIGURE_JSFPORTLET);
+ boolean configureSeamPortlet = store.getBoolean(Activator.CONFIGURE_SEAMPORTLET);
+ boolean configureCDI = store.getBoolean(Activator.CONFIGURE_CDI);
+ boolean configureHibernate = store.getBoolean(Activator.CONFIGURE_HIBERNATE);
+ boolean configureJaxRs = store.getBoolean(Activator.CONFIGURE_JAXRS);
+
try {
+ store.setValue(Activator.CONFIGURE_SEAM, false);
+ store.setValue(Activator.CONFIGURE_JSF, false);
+ store.setValue(Activator.CONFIGURE_PORTLET, false);
+ store.setValue(Activator.CONFIGURE_JSFPORTLET, false);
+ store.setValue(Activator.CONFIGURE_SEAMPORTLET, false);
+ store.setValue(Activator.CONFIGURE_CDI, false);
+ store.setValue(Activator.CONFIGURE_HIBERNATE, false);
+ store.setValue(Activator.CONFIGURE_JAXRS, false);
getContainer().run(true, false, op);
} catch (InterruptedException e) {
ProjectExamplesActivator.log(e);
@@ -139,6 +161,15 @@
}
MessageDialog.openError(getShell(), "Error", message);
return true;
+ } finally {
+ store.setValue(Activator.CONFIGURE_SEAM, configureSeam);
+ store.setValue(Activator.CONFIGURE_JSF, configureJSF);
+ store.setValue(Activator.CONFIGURE_PORTLET, configurePortlet);
+ store.setValue(Activator.CONFIGURE_JSFPORTLET, configureJSFPortlet);
+ store.setValue(Activator.CONFIGURE_SEAMPORTLET, configureSeamPortlet);
+ store.setValue(Activator.CONFIGURE_CDI, configureCDI);
+ store.setValue(Activator.CONFIGURE_HIBERNATE, configureHibernate);
+ store.setValue(Activator.CONFIGURE_JAXRS, configureJaxRs);
}
return true;
@@ -216,4 +247,8 @@
super.createPageControls(pageContainer);
simplePage.setUseDefaultWorkspaceLocation(ProjectExamplesActivator.getDefault().getPreferenceStore().getBoolean(ProjectExamplesActivator.PROJECT_EXAMPLES_DEFAULT));
}
+
+ public IPath getLocationPath() {
+ return locationPath;
+ }
}
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Activator.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Activator.java 2012-01-16
22:45:32 UTC (rev 37882)
+++
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Activator.java 2012-01-16
23:20:03 UTC (rev 37883)
@@ -79,7 +79,7 @@
public static final boolean CONFIGURE_HIBERNATE_VALUE = true;
- public static final String CONFIGURE_JAXRS = "configureJAX-RS";
+ public static final String CONFIGURE_JAXRS = "configureJAX-RS"; //$NON-NLS-1$
public static final boolean CONFIGURE_JAXRS_VALUE = true;
// The shared instance