Bug 454945 - Updating Maven Project repeatedly throws exception
Summary: Updating Maven Project repeatedly throws exception
Status: UNCONFIRMED
Alias: None
Product: M2E-WTP
Classification: Technology
Component: Core (show other bugs)
Version: 1.0.1   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-11 16:25 EST by Steven Maurer CLA
Modified: 2014-12-11 16:30 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Maurer CLA 2014-12-11 16:25:17 EST
I have installed the M2E connector on Luna, with the following versions.

M2E - Maven Integration for Eclipse 1.4.1.20140328-1905
m2e-wtp - Maven Integration for Eclipse WTP  Version: 1.0.1.20130911-1545

Now, when I try to do a (project)->Maven->Update Project, about half a dozen of my projects fail with the following error:

An internal error occurred during: "Updating Maven Project".
org.eclipse.m2e.wtp.WTPProjectsUtil.isM2eWtpDisabled(Lorg/eclipse/m2e/core/project/IMavenProjectFacade;Lorg/eclipse/core/runtime/IProgressMonitor;)Z

This is repeatable through all the standard ways to try to get it to work. Maven Clean doesn't work. Disabling & Reenabling Maven nature doesn't work. The console looks like this:

MAVEN CONSOLE:
12/10/14, 2:46:35 PM PST: [INFO] Update started
12/10/14, 2:46:35 PM PST: [INFO] Using org.maven.ide.eclipse.wtp.WarLifecycleMapping lifecycle mapping for MavenProject: com.secureworks.sif.webapp:webapp-sif:15.3.0-SNAPSHOT @ /home/smaurer/Documents/workspace-sts-3.4.0.RELEASE/maven.1395686819062/online-sif/sif/webapp-sif/pom.xml.

<<<<<<<<<<<<<<NOTE: ERROR WINDOW POPS UP ABOUT HERE>>>>>>>>>>>>>>

12/10/14, 2:46:36 PM PST: [INFO] Adding source folder /webapp-sif/src/main/java
12/10/14, 2:46:36 PM PST: [INFO] Adding resource folder /webapp-sif/src/main/resources
12/10/14, 2:46:36 PM PST: [INFO] Adding source folder /webapp-sif/src/test/java
12/10/14, 2:46:42 PM PST: [INFO] Using org.maven.ide.eclipse.wtp.WarLifecycleMapping lifecycle mapping for MavenProject: com.secureworks.sif.webapp:webapp-sif:15.3.0-SNAPSHOT @ /home/smaurer/Documents/workspace-sts-3.4.0.RELEASE/maven.1395686819062/online-sif/sif/webapp-sif/pom.xml.
12/10/14, 2:46:43 PM PST: [INFO] Bypassing LESS source: dell-fonts-ie8.less (not modified)
12/10/14, 2:46:44 PM PST: [INFO] Bypassing LESS source: styles.less (not modified)
12/10/14, 2:46:44 PM PST: [INFO] Complete Less compile job finished in 762 ms
12/10/14, 2:46:44 PM PST: [INFO] Using 'UTF-8' encoding to copy filtered resources.
12/10/14, 2:46:44 PM PST: [INFO] Copying 2 resources
12/10/14, 2:46:44 PM PST: [INFO] /home/smaurer/Documents/workspace-sts-3.4.0.RELEASE/maven.1395686819062/online-sif/sif/webapp-sif/src/main/webapp
12/10/14, 2:46:44 PM PST: [INFO] Executing the mojo: 
12/10/14, 2:46:44 PM PST: [INFO] Wro4j Model path: /home/smaurer/Documents/workspace-sts-3.4.0.RELEASE/maven.1395686819062/online-sif/sif/webapp-sif/src/main/webapp/WEB-INF/wro.xml
12/10/14, 2:46:44 PM PST: [INFO] targetGroups: scripts.min
12/10/14, 2:46:44 PM PST: [INFO] minimize: true
12/10/14, 2:46:44 PM PST: [INFO] ignoreMissingResources: false
12/10/14, 2:46:44 PM PST: [INFO] parallelProcessing: false
12/10/14, 2:46:44 PM PST: [INFO] buildDirectory: /home/smaurer/Documents/workspace-sts-3.4.0.RELEASE/maven.1395686819062/online-sif/sif/webapp-sif/target
12/10/14, 2:46:44 PM PST: [INFO] destinationFolder: /home/smaurer/Documents/workspace-sts-3.4.0.RELEASE/maven.1395686819062/online-sif/sif/webapp-sif/target/wro
12/10/14, 2:46:44 PM PST: [INFO] jsDestinationFolder: /home/smaurer/Documents/workspace-sts-3.4.0.RELEASE/maven.1395686819062/online-sif/sif/webapp-sif/target/wro/js
12/10/14, 2:46:44 PM PST: [INFO] cssDestinationFolder: /home/smaurer/Documents/workspace-sts-3.4.0.RELEASE/maven.1395686819062/online-sif/sif/webapp-sif/target/wro/css
12/10/14, 2:46:44 PM PST: [INFO] wroManagerFactory class: ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory
12/10/14, 2:46:46 PM PST: [INFO] The following groups will be processed: [scripts.min]
12/10/14, 2:46:46 PM PST: [INFO] folder: /home/smaurer/Documents/workspace-sts-3.4.0.RELEASE/maven.1395686819062/online-sif/sif/webapp-sif/target/wro/css
12/10/14, 2:46:46 PM PST: [INFO] processing group: scripts.min.css
12/10/14, 2:46:46 PM PST: [INFO] folder: /home/smaurer/Documents/workspace-sts-3.4.0.RELEASE/maven.1395686819062/online-sif/sif/webapp-sif/target/wro/js
12/10/14, 2:46:46 PM PST: [INFO] processing group: scripts.min.js
12/10/14, 2:47:16 PM PST: [INFO] file size: scripts.min.js -> 234383 bytes
12/10/14, 2:47:16 PM PST: [INFO] /home/smaurer/Documents/workspace-sts-3.4.0.RELEASE/maven.1395686819062/online-sif/sif/webapp-sif/target/wro/js/scripts.min.js (234383 bytes)
12/10/14, 2:47:16 PM PST: [INFO] Using 'UTF-8' encoding to copy filtered resources.
12/10/14, 2:47:16 PM PST: [INFO] skip non existing resourceDirectory /home/smaurer/Documents/workspace-sts-3.4.0.RELEASE/maven.1395686819062/online-sif/sif/webapp-sif/src/test/resources
12/10/14, 2:47:16 PM PST: [INFO] Changed resources require a complete clean of filtered resources of webapp-sif
12/10/14, 2:47:16 PM PST: [INFO] Executing resource filtering for webapp-sif
12/10/14, 2:47:16 PM PST: [WARN] The POM for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1 is missing, no dependency information available
12/10/14, 2:47:16 PM PST: [WARN] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.4.1: Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1

<<<<<<<<<<<<<<NOTE: THESE WARNINGS APPEAR TO BE UNRELATED>>>>>>>>>>>>>>


12/10/14, 2:47:16 PM PST: [WARN] The POM for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1 is missing, no dependency information available
12/10/14, 2:47:16 PM PST: [WARN] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.4.1: Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
12/10/14, 2:47:16 PM PST: [INFO] Using 'UTF-8' encoding to copy filtered resources.
12/10/14, 2:47:16 PM PST: [INFO] Copying 2 resources to css
12/10/14, 2:47:16 PM PST: [INFO] Copying 1 resource to js
- - - - - - - -

I went into github to look at the source for this, and found this:

public static boolean isM2eWtpDisabled(IMavenProjectFacade facade, IProgressMonitor monitor) {
	if (facade == null) {
	  return true;
	}
	MavenProject mavenProject;
	Object pomActivationValue = null; 
	try {
		mavenProject = facade.getMavenProject(monitor);
		pomActivationValue = mavenProject == null? null : mavenProject.getProperties().get(M2E_WTP_ACTIVATION_PROPERTY);
	} catch (CoreException ex) {
		// TODO Auto-generated catch block
		LOG.error("Unable to load Maven project",ex); //$NON-NLS-1$
	}
	boolean enabled;
	if (pomActivationValue == null) {
	  enabled = MavenWtpPlugin.getDefault().getMavenWtpPreferencesManager().getPreferences(facade.getProject()).isEnabled();
	} else {
	  enabled = Boolean.parseBoolean(pomActivationValue.toString());
	}	
	return !enabled;
  }
- - - - - - -

My assumption is that it might be throwing some sort of exception or NPE.


Note that this only appears to be a problem on some of my projects. In others, it works perfectly. So I know both that this isn't an install problem of the connector, and that there must be some data dependency on triggering this. My present guess is that it has something to do with the nature of projects themselves, though nothing appears to be missing.

Regardless, even if there is some sort of misconfiguration on my part, throwing an internal exception is a bug.
Comment 1 Fred Bricon CLA 2014-12-11 16:30:11 EST
Which version of Eclipse are you using? How did you install the m2e plugins?

m2e 1.5 and m2e-wtp 1.1 should be used with Eclipse Luna. They're installed by default with the Eclipse for JavaEE distribution