sonatype/m2eclipse-wtp — Issue #4: IllegalArgumentException in version 0.15
Author: harawata
Created: 2012-02-09 17:40:44+00:00
State: open

After upgraded m2e-wtp from **0.14.0.20110928-2045** to **0.15.1.20120208-1300**, I start getting java.lang.IllegalArgumentException when building maven wtp project which has a dependency to another project in the workspace.

### Steps to reproduce.

1. Import mybatis-parent (http://mybatis.googlecode.com/svn/sub-projects/mybatis-parent/trunk)
2. Import mybatis (http://mybatis.googlecode.com/svn/trunk). There would be compile errors, but it shouldn't matter.
3. Create a new project using maven-archtype-webapp.
4. Add mybatis as a dependency to the pom.xml of the project.

### Expeced result:

Dependency resolved.

### Actual result:

Build fails with the following exception.

```
java.lang.IllegalArgumentException: Path must include project and resource name: /mybatis
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2163)
at org.eclipse.core.internal.resources.Container.getFolder(Container.java:222)
at org.maven.ide.eclipse.wtp.AbstractProjectConfiguratorDelegate.checkJavaConfiguration(AbstractProjectConfiguratorDelegate.java:225)
at org.maven.ide.eclipse.wtp.AbstractProjectConfiguratorDelegate.configureWtpUtil(AbstractProjectConfiguratorDelegate.java:132)
at org.maven.ide.eclipse.wtp.AbstractProjectConfiguratorDelegate.preConfigureDependencyProject(AbstractProjectConfiguratorDelegate.java:292)
at org.maven.ide.eclipse.wtp.WebProjectConfiguratorDelegate.setModuleDependencies(WebProjectConfiguratorDelegate.java:250)
at org.maven.ide.eclipse.wtp.WTPProjectConfigurator.mavenProjectChanged(WTPProjectConfigurator.java:76)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.mavenProjectChanged(ProjectConfigurationManager.java:752)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:724)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:847)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:280)
at org.eclipse.m2e.core.internal.project.registry.MavenProjectManager.refresh(MavenProjectManager.java:58)
at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:120)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
```

### Additional information.

* Not all the in-workspace dependency causes the problem.
* If the project created in step 3 is a simple java project, build succeeds.
* The same setup works fine with m2e-wtp 0.14.0.20110928-2045.
* Tested with eclipse 3.7.1 and 3.7.2 RC2.
* m2e version is 1.0.100.20110804-1717.