### Eclipse Workspace Patch 1.0
#P org.jboss.tools.seam.base.test
Index: src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
===================================================================
--- src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java	(revision 31357)
+++ src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java	(working copy)
@@ -200,6 +200,7 @@
 		config.setStringProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, "org.test.beans");
 		config.setStringProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, "noop-connection");
 		config.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH, new String[] { "noop-driver.jar" });
+		config.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING, true);
 		return config;
 	}
 
Index: src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
===================================================================
--- src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java	(revision 31357)
+++ src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java	(working copy)
@@ -118,6 +118,7 @@
 		IDataModel dataModel = super.createSeamDataModel(deployType);
 		dataModel.setStringProperty(
 				ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, SEAM_2_0_0);
+		dataModel.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING, true);
 
 		return dataModel;
 	}
@@ -161,7 +162,119 @@
 						IContainer.class);
 		assertOnlyContainsTheseFiles(seamgenlibs, warLibs);
 	}
+	
+	public void testWarLibrariesCopying() throws CoreException{
+		checkWarLibrariesInSeamProject("warLibPrj", true);
+	}
+
+	public void testWarLibrariesNotCopying() throws CoreException{
+		checkWarLibrariesInSeamProject("warNoLibPrj", false);
+	}
+
+	public void testEarLibrariesCopying() throws CoreException{
+		checkEarLibrariesInSeamProject("earLibPrj", true);
+	}
+
+	protected void checkWarLibrariesInSeamProject(String warName, Boolean copyLibraries) throws CoreException{
+		IDataModel warModel = createSeamDataModel("war");
+		warModel.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING, copyLibraries);
+
+		IFacetedProject wProject = createSeamProject(warName, warModel);
+		IProject war = wProject.getProject();
+		
+		Set<String> onlyInWar = getWarLibs();
+
+		final IContainer warLibs = (IContainer) war.findMember("WebContent/WEB-INF/lib");
+
+		if(copyLibraries){
+			assertOnlyContainsTheseFiles(onlyInWar, warLibs);
+		}else{
+			assertContainsNoneOfTheseFiles(onlyInWar, warLibs);
+		}
+	}
+	
+	protected void checkEarLibrariesInSeamProject(String earName, Boolean copyLibraries) throws CoreException{
+		IDataModel earModel = createSeamDataModel("ear");
+		earModel.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING, copyLibraries);
+		
+		IFacetedProject eProject = createSeamProject(earName, earModel);
+		IProject war = eProject.getProject();
+		
+		SeamProjectsSet seamProjectsSet = new SeamProjectsSet(war);
+		
+		assertTrue(seamProjectsSet.getWarProject().exists());
+		assertTrue(seamProjectsSet.getTestProject().exists());
+		assertTrue(seamProjectsSet.getEjbProject().exists());
+		assertTrue(seamProjectsSet.getEarProject().exists());
+
+		IProject ear = seamProjectsSet.getEarProject();
+		IProject ejb = seamProjectsSet.getEjbProject();
+		IProject test = seamProjectsSet.getTestProject();
+		
+		Set<String> onlyInWar = getEarWarLibs();
+		Set<String> onlyInEar = getEarLibs();
+		Set<String> onlyInTest = getTestLibs();
+		Set<String> onlyInEarSeam = new HashSet<String>();
+		Set<String> onlyInEjbSrc = new HashSet<String>();
+		Set<String> onlyInEarMeta = new HashSet<String>();
+		
+		onlyInEarMeta.add("jboss-app.xml");
+		onlyInEarMeta.add("application.xml");
+
+		onlyInEjbSrc.add("security.drl");
+		onlyInEjbSrc.add("seam.properties");
+		onlyInEjbSrc.add("import.sql");
+		onlyInEjbSrc.add("components.properties");
+
+		onlyInEarSeam.add("jboss-seam.jar");
+		
+		if(copyLibraries){
+			onlyInEarSeam.add("lib");
+			onlyInEarSeam.add("META-INF");
+			onlyInEjbSrc.add("META-INF");
+			onlyInEjbSrc.add("org");
+			
+		}
+		
+		final IContainer earMeta = (IContainer) ear.findMember("EarContent/META-INF");
+
+		final IContainer warLibs = (IContainer) war.findMember("WebContent/WEB-INF/lib");
+
+		final IContainer earLibsSeam = (IContainer) ear.findMember("EarContent");
+
+		final IContainer earLibs = (IContainer) ear.findMember("EarContent/lib");
+		
+		final IContainer ejbSrc = (IContainer) ejb.findMember("ejbModule");
+
+		final IContainer testLibs = (IContainer) test.findMember("lib");
+
+		if(copyLibraries){
+			assertOnlyContainsTheseFiles(onlyInEjbSrc, ejbSrc);
+			
+			assertOnlyContainsTheseFiles(onlyInEarMeta, earMeta);
+			
+			assertOnlyContainsTheseFiles(onlyInEarSeam, earLibsSeam);
+
+			assertOnlyContainsTheseFiles(onlyInEar, earLibs);
+
+			assertOnlyContainsTheseFiles(onlyInWar, warLibs);
+			
+			assertOnlyContainsTheseFiles(onlyInTest, testLibs);
+		}else{
+			assertContainsNoneOfTheseFiles(onlyInEjbSrc, ejbSrc);
+			
+			assertContainsNoneOfTheseFiles(onlyInEarMeta, earMeta);
+			
+			assertContainsNoneOfTheseFiles(onlyInEarSeam, earLibsSeam);
+
+			assertContainsNoneOfTheseFiles(onlyInEar, earLibs);
 
+			assertContainsNoneOfTheseFiles(onlyInWar, warLibs);
+			
+			assertContainsNoneOfTheseFiles(onlyInTest, testLibs);
+		}
+	}
+	
 	public void testMvelWarJars() {
 		final IContainer warLibs = (IContainer) warProject.getProject()
 				.findMember("WebContent/WEB-INF/lib").getAdapter(
@@ -364,6 +477,32 @@
 				+ " at " + dir.getLocation(), foundFiles.isEmpty());
 	}
 
+	protected void assertContainsNoneOfTheseFiles(Set<String> fileNames,
+			final IResource dir) throws CoreException {
+		
+		if(dir == null)
+			return;
+		
+		final Set<String> foundFiles = new HashSet<String>();
+		dir.accept(new IResourceProxyVisitor() {
+
+			public boolean visit(IResourceProxy proxy) throws CoreException {
+				if (dir.getName().equals(proxy.getName()))
+					return true;
+				foundFiles.add(proxy.getName());
+				return false;
+			}
+
+		}, IResource.DEPTH_ZERO);
+		
+		for(String fileName : fileNames){
+			if(foundFiles.contains(fileName)){
+				fail("Found library: "+fileName);
+			}
+		}
+
+	}
+
 	public void testBootstrapDirPresent() throws CoreException, IOException {
 		SeamProjectsSet warPs = new SeamProjectsSet(warProject.getProject());
 
#P org.jboss.tools.seam.ui
Index: src/org/jboss/tools/seam/ui/messages.properties
===================================================================
--- src/org/jboss/tools/seam/ui/messages.properties	(revision 31357)
+++ src/org/jboss/tools/seam/ui/messages.properties	(working copy)
@@ -54,6 +54,8 @@
 SEAM_CONVERSATION_WIZARD_CREATE_NEW_CONVERSATION=Create New Conversation
 SEAM_CONVERSATION_WIZARD_PAGE1_SEAM_CONVERSATION=Seam Conversation
 SEAM_INSTALL_WIZARD_PAGE_TEST_PACKAGE_NAME=Test Package Name:
+SEAM_INSTALL_WIZARD_PAGE_COPY_LIBRARIES=Copy Libraries:
+SEAM_INSTALL_WIZARD_PAGE_COPY_RESOURCES=Copy Resources:
 SEAM_VIEW_LAYOUT_ACTION_GROUP_HIERARCHICAL=Hierarchical
 SEAM_RUNTIME_LIST_FIELD_EDITOR_HOME_FOLDER=Home Folder:
 SEAM_WIZARD_FACTORY_SEAM_ENTITY_CLASS_NAME=Seam entity class name:
Index: src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java	(revision 31357)
+++ src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java	(working copy)
@@ -311,6 +311,9 @@
 		SeamCorePlugin.getDefault().getPluginPreferences().setValue(
 				SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS,
 				this.jBossAsDeployAsEditor.getValueAsString());
+		
+		if(!isNewProjectWizard())
+			model.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING, false);
 	}
 	
 	/*
@@ -599,10 +602,6 @@
 		}
 	}
 
-	private boolean isNewSeamProjectWizard() {
-		return getWizard() == null || getWizard() instanceof SeamProjectWizard;
-	}
-
 	private boolean isNewProjectWizard() {
 		// ModifyFacetedProjectWizard or NewProjectDataModelFacetWizard
 		return getWizard() == null
Index: src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
--- src/org/jboss/tools/seam/ui/SeamUIMessages.java	(revision 31357)
+++ src/org/jboss/tools/seam/ui/SeamUIMessages.java	(working copy)
@@ -136,6 +136,10 @@
 	public static String SEAM_INSTALL_WIZARD_PAGE_SESSION_BEAN_PACKAGE_NAME;
 
 	public static String SEAM_INSTALL_WIZARD_PAGE_TEST_PACKAGE_NAME;
+	
+	public static String SEAM_INSTALL_WIZARD_PAGE_COPY_LIBRARIES;
+	
+	public static String SEAM_INSTALL_WIZARD_PAGE_COPY_RESOURCES;
 
 	public static String SEAM_OPEN_ACTION_OPEN;
 
#P org.jboss.tools.seam.core
Index: src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
===================================================================
--- src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java	(revision 31357)
+++ src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java	(working copy)
@@ -92,6 +92,7 @@
 		names.add(ISeamFacetDataModelProperties.CREATE_EAR_PROJECTS);
 		names.add(CONFIGURE_DEFAULT_SEAM_RUNTIME);
 		names.add(CONFIGURE_WAR_PROJECT);
+		names.add(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING);
 		
 		return names;
 	}
Index: src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java	(revision 31357)
+++ src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java	(working copy)
@@ -113,7 +113,7 @@
 			IDataModel model, IProgressMonitor monitor) throws CoreException {
 		super.doExecuteForEjb(project, fv, model, monitor);
 		IResource src = getSrcFolder(project);
-		if(src!=null && seamHomeFolder!=null) {
+		if(src!=null && seamHomeFolder!=null && model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING)) {
 			File srcFile = src.getLocation().toFile();
 			AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "security.drl"), srcFile, false); //$NON-NLS-1$
 		}
@@ -126,6 +126,9 @@
 	@Override
 	protected void copyFilesToWarProject(final IProject project, IProjectFacetVersion fv,
 			IDataModel model, IProgressMonitor monitor) throws CoreException {
+		if(!model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING))
+			return;
+		
 		super.copyFilesToWarProject(project, fv, model, monitor);
 		final File droolsLibFolder = new File(seamHomePath, DROOLS_LIB_SEAM_RELATED_PATH);
 		if(isWarConfiguration(model)) {
@@ -153,7 +156,10 @@
 	 * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#fillEarContents()
 	 */
 	@Override
-	protected void fillEarContents(IProject project) {
+	protected void fillEarContents(IProject project, IDataModel model) {
+		if(!model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING))
+			return;
+		
 		if (!SeamCorePlugin.getDefault().hasM2Facet(project)) {
 			final File droolsLibFolder = new File(seamHomePath, DROOLS_LIB_SEAM_RELATED_PATH);
 			AntCopyUtils.copyFiles(seamHomeFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamHomeFolder)), false);
Index: src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
===================================================================
--- src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java	(revision 31357)
+++ src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java	(working copy)
@@ -305,4 +305,10 @@
 	String CONFIGURE_WAR_PROJECT = "configure.war.project"; //$NON-NLS-1$
 
 	String SEAM_SETTINGS_CHANGED_BY_USER = "seam.settings.changed.by.user"; //$NON-NLS-1$
+	
+	/**
+	 * This flag indicates that we should copy libraries from Seam Runtime to projects.
+	 * Can be "true" or "false".
+	 */
+	String SEAM_RUNTIME_LIBRARIES_COPYING = "seam.runtime.libraries.copying"; //$NON-NLS-1$
 }
\ No newline at end of file
Index: src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java
===================================================================
--- src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java	(revision 31357)
+++ src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java	(working copy)
@@ -89,7 +89,7 @@
 	@Override
 	protected void createEarProject() {
 		super.createEarProject();
-		if (!SeamCorePlugin.getDefault().hasM2Facet(seamWebProject)) {
+		if (!SeamCorePlugin.getDefault().hasM2Facet(seamWebProject) && model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING)) {
 			File earContentsFolder = new File(earProjectFolder, "EarContent"); //$NON-NLS-1$
 			File earLibFolder = new File(earContentsFolder, "lib"); //$NON-NLS-1$
 			AntCopyUtils.copyFiles(seamLibFolder, earLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(Seam2FacetInstallDelegate.JBOSS_EAR_LIB).dir(seamLibFolder)));
@@ -98,7 +98,7 @@
 
 	@Override
 	protected boolean createTestProject() {
-		if(!(Boolean)model.getProperty(ISeamFacetDataModelProperties.TEST_PROJECT_CREATING))
+		if(!(Boolean)model.getProperty(ISeamFacetDataModelProperties.TEST_PROJECT_CREATING) || !model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING))
 			return false;
 		
 		File testProjectDir = new File(seamWebProject.getLocation().removeLastSegments(1).toFile(), testProjectName); //$NON-NLS-1$
@@ -244,7 +244,8 @@
 	protected void createEjbProject() {
 		super.createEjbProject();
 		// Copy security.drl to source folder
-		AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "security.drl"), new File(ejbProjectFolder, "ejbModule/"), true); //$NON-NLS-1$ //$NON-NLS-2$
+		if(model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING))
+			AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "security.drl"), new File(ejbProjectFolder, "ejbModule/"), true); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 
 	@Override
Index: src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
===================================================================
--- src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java	(revision 31357)
+++ src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java	(working copy)
@@ -267,12 +267,15 @@
 				});
 				StringBuffer earJarsStrWar = new StringBuffer();
 				StringBuffer earJarsStrEjb = new StringBuffer();
-				for (File file : earJars) {
-					earJarsStrWar.append(" ").append(file.getName()).append(" \n");
-					if (isJBossSeamJar(file)) {
-						jbossSeamPath = file.getAbsolutePath();
-					} else {
-						earJarsStrEjb.append(" ").append(file.getName()).append(" \n");
+				
+				if(earJars != null){
+					for (File file : earJars) {
+						earJarsStrWar.append(" ").append(file.getName()).append(" \n");
+						if (isJBossSeamJar(file)) {
+							jbossSeamPath = file.getAbsolutePath();
+						} else {
+							earJarsStrEjb.append(" ").append(file.getName()).append(" \n");
+						}
 					}
 				}
 
@@ -283,13 +286,17 @@
 				FilterSet manifestFilterWar = new FilterSet();
 				manifestFilterWar.addFilter("earLibs", earJarsStrWar.toString()); //$NON-NLS-1$
 				manifestFilterColWar.addFilterSet(manifestFilterWar);
-				AntCopyUtils.copyFileToFolder(new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "war/META-INF/MANIFEST.MF"), webMetaInf, manifestFilterColWar, true); //$NON-NLS-1$
+				
+				if(model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING))
+					AntCopyUtils.copyFileToFolder(new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "war/META-INF/MANIFEST.MF"), webMetaInf, manifestFilterColWar, true); //$NON-NLS-1$
 
 				FilterSetCollection manifestFilterColEjb = new FilterSetCollection(projectFilterSet);
 				FilterSet manifestFilterEjb = new FilterSet();
 				manifestFilterEjb.addFilter("earClasspath", earJarsStrEjb.toString()); //$NON-NLS-1$
 				manifestFilterColEjb.addFilterSet(manifestFilterEjb);
-				AntCopyUtils.copyFileToFolder(new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "ejb/ejbModule/META-INF/MANIFEST.MF"), ejbMetaInf, manifestFilterColEjb, true); //$NON-NLS-1$
+				
+				if(model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING))
+					AntCopyUtils.copyFileToFolder(new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "ejb/ejbModule/META-INF/MANIFEST.MF"), ejbMetaInf, manifestFilterColEjb, true); //$NON-NLS-1$
 			} catch (IOException e) {
 				SeamCorePlugin.getPluginLog().logError(e);
 			}
@@ -449,7 +456,7 @@
 	 * Creates test project for given seam web project.
 	 */
 	protected boolean createTestProject() {
-		if(!(Boolean)model.getProperty(ISeamFacetDataModelProperties.TEST_PROJECT_CREATING))
+		if(!(Boolean)model.getProperty(ISeamFacetDataModelProperties.TEST_PROJECT_CREATING) || !model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING))
 			return false;
 
 		File testProjectDir = new File(seamWebProject.getLocation().removeLastSegments(1).toFile(), testProjectName); //$NON-NLS-1$
@@ -541,6 +548,9 @@
 	}
 
 	protected void createEjbProject() {
+		if(!model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING))
+			return;
+		
 		ejbProjectFolder.mkdir();
 
 		AntCopyUtils.copyFilesAndFolders(
@@ -602,6 +612,9 @@
 	}
 
 	protected void createEarProject() {
+		if(!model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING))
+			return;
+		
 		earProjectFolder.mkdir();
 
 		File earContentsFolder = new File(earProjectFolder, "EarContent"); //$NON-NLS-1$
@@ -626,14 +639,14 @@
 		} catch (IOException e) {
 			SeamCorePlugin.getPluginLog().logError(e);
 		}
-
+	
 		// Fill ear contents
 		AntCopyUtils.copyFiles(seamHomeFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamHomeFolder)));
 		if (!SeamCorePlugin.getDefault().hasM2Facet(seamWebProject)) {
 			AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamLibFolder)));
 			AntCopyUtils.copyFiles(droolsLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(droolsLibFolder)));
 		}
-		AntCopyUtils.copyFiles(seamGenResFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamGenResFolder)));						
+		AntCopyUtils.copyFiles(seamGenResFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(getJbossEarContent()).dir(seamGenResFolder)));
 
 		File resources = new File(earProjectFolder, "resources");
 		AntCopyUtils.copyFileToFile(
Index: src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java	(revision 31357)
+++ src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java	(working copy)
@@ -386,6 +386,9 @@
 	 */
 	protected void copyFilesToWarProject(IProject project, IProjectFacetVersion fv,
 			IDataModel model, IProgressMonitor monitor) throws CoreException {
+		
+		if(!model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING))
+			return;
 
 		final AntCopyUtils.FileSet viewFileSet = new AntCopyUtils.FileSet(VIEW_FILESET).dir(seamGenViewSource);
 		AntCopyUtils.copyFilesAndFolders(
@@ -552,28 +555,35 @@
 		FilterSet earFilterSet =  new FilterSet();
 		earFilterSet.addFilter("projectName", project.getName() + ".ear"); //$NON-NLS-1$ //$NON-NLS-2$
 
-		AntCopyUtils.copyFileToFolder(
-			new File(seamGenResFolder, "META-INF/jboss-app.xml"), //$NON-NLS-1$
-			metaInfFolder, new FilterSetCollection(earFilterSet), false);
+		if(model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING)){
+			AntCopyUtils.copyFileToFolder(
+				new File(seamGenResFolder, "META-INF/jboss-app.xml"), //$NON-NLS-1$
+				metaInfFolder, new FilterSetCollection(earFilterSet), false);
+		}
 
 		if(applicationXml.exists()) {
 			configureApplicationXml(project, monitor);
 		}
-		// Copy configuration files from template
-		try {
-			AntCopyUtils.copyFilesAndFolders(
-				new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "ear"),  //$NON-NLS-1$
-				earProjectFolder, new FilterSetCollection(ejbFilterSet), false);
-		} catch (IOException e) {
-			SeamCorePlugin.getPluginLog().logError(e);
+		
+		if(model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING)){
+			// Copy configuration files from template
+			try {
+				AntCopyUtils.copyFilesAndFolders(
+					new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "ear"),  //$NON-NLS-1$
+					earProjectFolder, new FilterSetCollection(ejbFilterSet), false);
+			} catch (IOException e) {
+				SeamCorePlugin.getPluginLog().logError(e);
+			}
 		}
 
-		fillEarContents(project);
+		fillEarContents(project, model);
 
-		File resources = new File(earProjectFolder, "resources"); //$NON-NLS-1$
-		AntCopyUtils.copyFileToFile(
-			dataSourceDsFile, new File(resources, project.getName() + "-ds.xml"),  //$NON-NLS-1$
-			viewFilterSetCollection, false);
+		if(model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING)){
+			File resources = new File(earProjectFolder, "resources"); //$NON-NLS-1$
+			AntCopyUtils.copyFileToFile(
+				dataSourceDsFile, new File(resources, project.getName() + "-ds.xml"),  //$NON-NLS-1$
+				viewFilterSetCollection, false);
+		}
 	}
 
 	protected void configureApplicationXml(IProject project, IProgressMonitor monitor) {
@@ -612,7 +622,7 @@
 	/**
 	 * Fill ear contents
 	 */
-	abstract protected void fillEarContents(IProject project);
+	abstract protected void fillEarContents(IProject project, IDataModel model);
 
 	protected IResource getSrcFolder(IProject project) throws JavaModelException {
 		IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
@@ -661,14 +671,16 @@
 			viewFilterSetCollection.addFilterSet(projectFilterSet);
 
 			File srcFile = src.getLocation().toFile();
-			// Copy sources to EJB project in case of EAR configuration
-			AntCopyUtils.copyFileToFile(
-				new File(seamGenHomeFolder, "src/Authenticator.java"), //$NON-NLS-1$
-				new File(srcFile, model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME).toString().replace('.', '/') + "/" + "Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-				new FilterSetCollection(filtersFilterSet), false);
+			if(model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING)){
+				// Copy sources to EJB project in case of EAR configuration
+				AntCopyUtils.copyFileToFile(
+					new File(seamGenHomeFolder, "src/Authenticator.java"), //$NON-NLS-1$
+					new File(srcFile, model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME).toString().replace('.', '/') + "/" + "Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+					new FilterSetCollection(filtersFilterSet), false);
+			}
 
 			File persistentXml = new File(srcFile, "META-INF/persistence.xml"); //$NON-NLS-1$
-			if(!persistentXml.exists()) {
+			if(!persistentXml.exists() && model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING)) {
 				AntCopyUtils.copyFileToFile(persistenceFile, new File(srcFile, "META-INF/persistence.xml"), //$NON-NLS-1$
 						viewFilterSetCollection, false);
 			} else {
@@ -681,10 +693,12 @@
 			}
 
 			AntCopyUtils.FileSet ejbSrcResourcesSet = new AntCopyUtils.FileSet(JBOOS_EJB_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
-			AntCopyUtils.copyFilesAndFolders(seamGenResFolder, srcFile, new AntCopyUtils.FileSetFileFilter(ejbSrcResourcesSet), viewFilterSetCollection, false);
+			if(model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING)){
+				AntCopyUtils.copyFilesAndFolders(seamGenResFolder, srcFile, new AntCopyUtils.FileSetFileFilter(ejbSrcResourcesSet), viewFilterSetCollection, false);
+			}
 
 			File ejbJarXml = new File(srcFile, "META-INF/ejb-jar.xml"); //$NON-NLS-1$
-			if(!ejbJarXml.exists()) {
+			if(!ejbJarXml.exists() && model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING)) {
 				AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "META-INF/ejb-jar.xml"), //$NON-NLS-1$
 					new File(srcFile, "META-INF"), viewFilterSetCollection, false); //$NON-NLS-1$
 			} else {
@@ -692,13 +706,15 @@
 			}
 		}
 
-		AntCopyUtils.copyFileToFile(
-				hibernateConsoleLaunchFile,
-				new File(ejbProjectFolder, getLaunchCfgName(ejbProjectFolder.getName()) + ".launch"), //$NON-NLS-1$
-				new FilterSetCollection(ejbFilterSet), false);
-
-		AntCopyUtils.copyFileToFolder(hibernateConsolePropsFile,
-			ejbProjectFolder, hibernateDialectFilterSet, false);
+		if(model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING)){
+			AntCopyUtils.copyFileToFile(
+					hibernateConsoleLaunchFile,
+					new File(ejbProjectFolder, getLaunchCfgName(ejbProjectFolder.getName()) + ".launch"), //$NON-NLS-1$
+					new FilterSetCollection(ejbFilterSet), false);
+	
+			AntCopyUtils.copyFileToFolder(hibernateConsolePropsFile,
+				ejbProjectFolder, hibernateDialectFilterSet, false);
+		}
 	}
 
 	enum ProjectType {
@@ -727,11 +743,16 @@
 	public void doExecute(final IProject project, IProjectFacetVersion fv,
 			Object config, IProgressMonitor monitor) throws CoreException {
 		final IDataModel model = (IDataModel)config;
+		
 		IFacetedProject facetedProject = ProjectFacetsManager.create(project);
 		IProjectFacetVersion ejbVersion = facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.EJB_FACET);
 		IProjectFacetVersion webVersion = facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET);
 		IProjectFacetVersion earVersion = facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.ENTERPRISE_APPLICATION_FACET);
-		IProjectFacetVersion jpaVersion = facetedProject.getProjectFacetVersion(ProjectFacetsManager.getProjectFacet("jpt.jpa"));
+		
+		IProjectFacetVersion jpaVersion = null;
+		if(ProjectFacetsManager.isProjectFacetDefined("jpt.jpa"))
+			jpaVersion = facetedProject.getProjectFacetVersion(ProjectFacetsManager.getProjectFacet("jpt.jpa"));
+		
 		initDefaultModelValues(model, webVersion!=null);
 
 		model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
@@ -916,6 +937,9 @@
 				model.setProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, names.get(0));
 			}
 		}
+		if(model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING)==null) {
+			model.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING, true);
+		}
 	}
 
 	/**
Index: src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
===================================================================
--- src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java	(revision 31357)
+++ src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java	(working copy)
@@ -131,6 +131,10 @@
 	@Override
 	protected void copyFilesToWarProject(final IProject project, IProjectFacetVersion fv,
 			IDataModel model, IProgressMonitor monitor) throws CoreException {
+		
+		if(!model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING))
+			return;
+		
 		super.copyFilesToWarProject(project, fv, model, monitor);
 		final File droolsLibFolder = new File(seamHomePath, DROOLS_LIB_SEAM_RELATED_PATH);
 		if (isWarConfiguration(model)) {
@@ -149,7 +153,10 @@
 	 * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#fillEarContents()
 	 */
 	@Override
-	protected void fillEarContents(IProject project) {
+	protected void fillEarContents(IProject project, IDataModel model) {
+		if(!model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING))
+			return;
+		
 		final File droolsLibFolder = new File(seamHomePath, DROOLS_LIB_SEAM_RELATED_PATH);
 		AntCopyUtils.copyFiles(seamHomeFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamHomeFolder)), false);
 		AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)), false);
