Author: snjeza
Date: 2011-06-01 17:19:11 -0400 (Wed, 01 Jun 2011)
New Revision: 31755
Modified:
trunk/maven/plugins/org.jboss.tools.maven.jsf/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java
Log:
JBIDE-8687 JSF tooling adds an Faces Servlet declaration with no servlet mappings on
project import
Modified: trunk/maven/plugins/org.jboss.tools.maven.jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.jsf/META-INF/MANIFEST.MF 2011-06-01 21:18:21
UTC (rev 31754)
+++ trunk/maven/plugins/org.jboss.tools.maven.jsf/META-INF/MANIFEST.MF 2011-06-01 21:19:11
UTC (rev 31755)
@@ -4,15 +4,15 @@
Bundle-SymbolicName: org.jboss.tools.maven.jsf;singleton:=true
Bundle-Version: 1.2.0.qualifier
Bundle-Activator: org.jboss.tools.maven.jsf.MavenJSFActivator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
+Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
org.jboss.tools.maven.core,
org.jboss.tools.maven.ui,
org.jboss.tools.common.model,
- org.eclipse.jst.j2ee.core,
- org.eclipse.jst.j2ee,
- org.eclipse.wst.common.emfworkbench.integration,
- org.eclipse.jst.jsf.core
+ org.eclipse.jst.j2ee.core;bundle-version="1.2.100",
+ org.eclipse.jst.j2ee;bundle-version="1.1.500",
+ org.eclipse.wst.common.emfworkbench.integration;bundle-version="1.2.100",
+ org.eclipse.jst.jsf.core;bundle-version="1.3.4"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %Bundle-Vendor
Modified:
trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java 2011-06-01
21:18:21 UTC (rev 31754)
+++
trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java 2011-06-01
21:19:11 UTC (rev 31755)
@@ -11,7 +11,6 @@
package org.jboss.tools.maven.jsf.configurators;
import java.io.File;
-import java.io.IOException;
import java.util.List;
import org.apache.maven.artifact.Artifact;
@@ -27,6 +26,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.preference.IPreferenceStore;
+import
org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
@@ -38,9 +38,6 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.jboss.tools.maven.core.IJBossMavenConstants;
import
org.jboss.tools.maven.core.internal.project.facet.MavenFacetInstallDataModelProvider;
import org.jboss.tools.maven.jsf.MavenJSFActivator;
@@ -177,41 +174,9 @@
fproj.installProjectFacet(jsfVersion12, model, monitor);
}
else if (jsfVersionString.startsWith("2.0")) { //$NON-NLS-1$
- String webXmlString = null;
- IFile webXml = null;
- webXml = getWebXml(fproj, mavenProject);
- boolean webXmlExists = webXml != null && webXml.exists();
- if (!configureWebxml() && webXmlExists) {
- IStructuredModel webXmlModel = null;
- try {
- webXmlModel = StructuredModelManager.getModelManager().getModelForRead(webXml);
- IStructuredDocument doc = webXmlModel.getStructuredDocument();
- webXmlString = doc.get();
- } catch (IOException e) {
- MavenJSFActivator.log(e);
- } finally {
- if (webXmlModel != null) {
- webXmlModel.releaseFromRead();
- }
- }
- }
IDataModel model =
MavenJSFActivator.getDefault().createJSFDataModel(fproj,jsfVersion20);
+ model.setBooleanProperty(IJSFFacetInstallDataModelProperties.CONFIGURE_SERVLET,configureWebxml());
fproj.installProjectFacet(jsfVersion20, model, monitor);
- if (!configureWebxml() && webXmlExists && webXmlString != null) {
- IStructuredModel webXmlModel = null;
- try {
- webXmlModel = StructuredModelManager.getModelManager().getModelForEdit(webXml);
- IStructuredDocument doc = webXmlModel.getStructuredDocument();
- doc.set(webXmlString);
- webXmlModel.save();
- } catch (IOException e) {
- MavenJSFActivator.log(e);
- } finally {
- if (webXmlModel != null) {
- webXmlModel.releaseFromEdit();
- }
- }
- }
}
if (shouldFixFacesConfig && generatedFacesConfig.exists()) {
Show replies by date