Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] generate-sources

The reason axistools-maven-plugin kinda works in 0.12.x is a side effect
of m2e running full maven build lifecycle during some operations. But
0.12.x does not guarantee code generation actually happens when it is
expected to happen in 0.12.x. Running maven build lifecycle is also
known to cause endless build loops and other nasty side effects like
resources going missing, which happened to be the most voted m2e
bugreport until we closed it recently.

To make sure axistools-maven-plugin works proper inside Eclipse
workspace, m2e has to know what files trigger code generation and what
files get generated by it. This does not mean this metadata has to come
from your projects' pom.xml files, however. In fact, our preferred
mechanism is m2e extension that tells m2e what to do with
axistools-maven-plugin and has corresponding tests to make sure
everything works as expected. From user's point of view, this will be
almost completely transparent. If the extension is installed, then
everything will just work. If the extension is not installed, m2e will
provide a quick fix wizard that will discover and install the extension
in couple of GUI clicks.

Somebody has to write that extension, though...


--
Regards,
Igor



On 11-01-24 04:29 AM, Thorsten Heit wrote:
Hi,

Generally, code generation requires explicit support from one of
installed m2e extensions. There is currently support for modello and
antlr/antlr3 available from m2e-extras update site.

To make this work in m2e 0.12.x, you need to configure what we call
"custom lifecycle mapping" and you can find few examples in [1] and [2].

In m2e 0.13.x, code generation is expected to work without any
configuration in pom.xml or at least you should get clear error message
what additional m2e extensions are required.

In my pom.xml I'm using the axistools-maven-plugin to generate Java code
from a WSDL:

<plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>axistools-maven-plugin</artifactId>
         <version>1.4</version>
         <executions>
                 <execution>
                         <id>create-java-sources</id>
                         <phase>generate-sources</phase>
                         <goals>
                                 <goal>wsdl2java</goal>
                         </goals>
                         <configuration>
                                 <wrapArrays>false</wrapArrays>
  <typeMappingVersion>1.2</typeMappingVersion>
                         </configuration>
                 </execution>
         </executions>
         <dependencies>
                 <dependency>
                         <groupId>javax.mail</groupId>
                         <artifactId>mail</artifactId>
                         <version>1.4.1</version>
                 </dependency>
                 <dependency>
                         <groupId>javax.activation</groupId>
                         <artifactId>activation</artifactId>
                         <version>1.1</version>
                 </dependency>
         </dependencies>
</plugin>


The code gets generated in the folder
target/generated-sources/axistools/wsdl2java. Works nice, both from the
command-line and from within Eclipse. AFAIR the only thing I had to do
only once after adding the plugin was to right-click on the project and
then select Maven ->  Update Project Configuration.

I don't see why it's necessary to create a custom lifecyle mapping, at
least for axistools-m-p...?


Regards

Thorsten
_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users


Back to the top