theit/m2e-lifecycle-axistools — Issue #1: Axistools-maven-plugin Error with configuration tag <outputDirectory>
Author: fisy
Created: 2011-12-15 17:05:57+00:00
State: open

Hello,

First of all, sorry for my poor english. I hope I'll make my self clear.

I'm having a problem in my maven project trying to make it work with te eclipse plugin m2e-lifecycle-axistools.

The project has the next configurattion for the axistools plugin:

```xml

org.codehaus.mojo
axistools-maven-plugin
1.4

UTF-8
src/main/resources

mcgdws.wsdl

src/main/java
src/main/java/mcgdws
es.mcgdws
true
true
true
true

wsdl2java

wsdl2java

javax.mail
mail
1.4.3

javax.activation
activation
1.1.1

```

When I run maven manually, everything works just fine and the classes I need are generated correctly in the *src/main/java* project folder.

The problem comes when I update the project configuration in eclipse (Version Helios Service Release 2), with m2e plugin (version 1.0.100.20110804-1717) and the M2E lifecycle configuration for the Axistools Maven plugin (version 1.1.0.201111221420).

I'm getting the next error:

**Unable to update Maven configuration
Could not get mojo execution parameter value
Cannot assign configuration entry 'outputDirectory' with value 'src/main/java' of type java.lang.String to property of type
java.io.File[]**

The validator is expecting a File array, but in the plugin documentation (http://mojo.codehaus.org/axistools-maven-plugin/wsdl2java-mojo.html#outputDirectory) it says is just one file.

Looking through the plugin source code I found that the class ***de.theit.m2e.axistools.internal.AxistoolsCodeGenProjectConfigurator*** is overrwriting the ***getSourceFolders*** method. The configuration field *outputDirectory* is being returned as a ***File[]*** type, when it's actual type is ***File***. The original inherited class (***org.eclipse.m2e.jdt.AbstractJavaProjectConfigurator***) manages correctly that configuration parameter.

Here there is a patch that may be useful (I attach the content o the patch diff file).

```diff
@@ -40,18 +40,6 @@ public class AxistoolsCodeGenProjectConfigurator extends
IMavenProjectFacade projectFacade, MojoExecution execution,
IPluginExecutionMetadata executionMetadata) {
return new AxistoolsCodeGenBuildParticipant(execution);
}

- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.m2e.jdt.AbstractJavaProjectConfigurator#getSourceFolders(org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest,
- * org.apache.maven.plugin.MojoExecution)
- */
- @Override
- protected File[] getSourceFolders(ProjectConfigurationRequest request,
- MojoExecution mojoExecution) throws CoreException {
- return getParameterValue("outputDirectory", File[].class,
- request.getMavenSession(), mojoExecution);
- }
}
```
I hope it'll be useful to fix the problem easily.

Thank you