Author: dgolovin
Date: 2010-07-15 13:52:16 -0400 (Thu, 15 Jul 2010)
New Revision: 23424
Modified:
branches/jbosstools-3.2.0.M1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
branches/jbosstools-3.2.0.M1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
Log:
https://jira.jboss.org/browse/JBIDE-6596 New Seam WAR project has incorrect deployment
artifact structure
patch proposed by Snjezana applied to the M1 branch.
issue is confirmed to be replicated without patch and not to be with applied patch.
Modified:
branches/jbosstools-3.2.0.M1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
---
branches/jbosstools-3.2.0.M1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2010-07-15
17:50:38 UTC (rev 23423)
+++
branches/jbosstools-3.2.0.M1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2010-07-15
17:52:16 UTC (rev 23424)
@@ -22,6 +22,7 @@
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jst.server.core.IJ2EEModule;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
@@ -107,8 +108,13 @@
IModuleResource[] members = getResources(module);
ArrayList<IStatus> list = new ArrayList<IStatus>();
+ IJ2EEModule j2eeModule = (IJ2EEModule) module.loadAdapter(IJ2EEModule.class, null);
+ boolean delete = true;
+ if (j2eeModule != null && j2eeModule.isBinary()) {
+ delete = false;
+ }
// if the module we're publishing is a project, not a binary, clean it's
folder
- if( !(new Path(module.getName()).segmentCount() > 1 ))
+ if( !(new Path(module.getName()).segmentCount() > 1 ) && delete)
list.addAll(Arrays.asList(localSafeDelete(deployPath)));
if( !deployPackaged(moduleTree) && !isBinaryObject(moduleTree)) {
Modified:
branches/jbosstools-3.2.0.M1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
===================================================================
---
branches/jbosstools-3.2.0.M1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2010-07-15
17:50:38 UTC (rev 23423)
+++
branches/jbosstools-3.2.0.M1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2010-07-15
17:52:16 UTC (rev 23424)
@@ -22,6 +22,7 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jst.server.core.IEnterpriseApplication;
+import org.eclipse.jst.server.core.IJ2EEModule;
import org.eclipse.wst.common.componentcore.ModuleCoreNature;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.internal.DeletedModule;
@@ -37,11 +38,11 @@
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.xpl.ModulePackager;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.ide.eclipse.as.core.util.IWTPConstants;
import
org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentModulePrefs;
import
org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentPreferences;
import
org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentTypePrefs;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.IWTPConstants;
public class PublishUtil {
public static int countChanges(IModuleResourceDelta[] deltas) {
@@ -126,7 +127,11 @@
public static IPath getDeployPath(IModule[] moduleTree, String deployFolder) {
IPath root = new Path( deployFolder );
String type, modName, name, uri, suffixedName;
- for( int i = 0; i < moduleTree.length; i++ ) {
+ for( int i = 0; i < moduleTree.length; i++ ) {
+ IJ2EEModule j2eeModule = (IJ2EEModule) moduleTree[i].loadAdapter(IJ2EEModule.class,
null);
+ if (j2eeModule != null && j2eeModule.isBinary()) {
+ continue;
+ }
type = moduleTree[i].getModuleType().getId();
modName = moduleTree[i].getName();
name = new Path(modName).lastSegment();