Enunciate multiple time running with maven

530 Views Asked by At

I'm using enunciate 1.27 and maven 3.0.4 .
My problem occurs when I run enunciate multiple times :

[INFO]
[INFO] --- maven-enunciate-plugin:1.27:assemble (number2) @ yaghut-web ---
[INFO] initializing enunciate.
[INFO] [csharp] C# compilation is disabled, but the source code will still be generated.
[INFO] invoking enunciate:generate step...
An exception has occurred in apt (1.6.0_30). Please file a bug at the Java Developer Connection     (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for     duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.NullPointerException
        at com.sun.tools.apt.comp.Apt$AptTreeScanner.visitAnnotation(Apt.java:161)
        at com.sun.tools.javac.tree.JCTree$JCAnnotation.accept(JCTree.java:1794)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:33)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:41)
        at com.sun.tools.javac.tree.TreeScanner.visitModifiers(TreeScanner.java:266)
        at com.sun.tools.javac.tree.JCTree$JCModifiers.accept(JCTree.java:1816)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:33)
        at com.sun.tools.javac.tree.TreeScanner.visitClassDef(TreeScanner.java:60)
        at com.sun.tools.apt.comp.Apt$AptTreeScanner.visitClassDef(Apt.java:146)
        at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:575)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:33)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:41)
        at com.sun.tools.javac.tree.TreeScanner.visitTopLevel(TreeScanner.java:52)
        at com.sun.tools.apt.comp.Apt$AptTreeScanner.visitTopLevel(Apt.java:124)
        at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
        at com.sun.tools.apt.comp.Apt.main(Apt.java:213)
      ....
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:

I execute enunciate in this way:

<execution>
<id>number1</id>
<goals>
    <goal>assemble</goal>
</goals>
<configuration>
    <configFile>src/main/enunciate_number1.xml</configFile>
    <compilationEncoding>UTF-8</compilationEncoding>
    <generateDir>${project.build.directory}/enunciate/number1/generate</generateDir>
    <compileDir>${project.build.directory}/enunciate/number1/compile</compileDir>
    <buildDir>${project.build.directory}/enunciate/number1/build</buildDir>
</configuration>
</execution>
<execution>
    <id>number2</id>
    <goals>
        <goal>assemble</goal>
    </goals>
    <configuration>
        <configFile>${project.basedir}/src/main/enunciate_number2.xml</configFile>
        <compilationEncoding>UTF-8</compilationEncoding>
        <generateDir>${project.build.directory}/enunciate/number2/generate</generateDir>
        <compileDir>${project.build.directory}/enunciate/number2/compile</compileDir>
        <buildDir>${project.build.directory}/enunciate/number2/build</buildDir>
    </configuration>
</execution>

when I executed enunciate one time (I mean omit number2) everything work correctly.
I guessed 'generateDir' in second execution was not set correctly. When I omit it, nothing was generated (message was: everythis appears up-to-date); and with current configuration, NullPointerException is thrown.

any idea?
thanks.

1

There are 1 best solutions below

0
On

I don't know much about how to configure Maven to get this right, but an alternative approach might be to use the maven-antrun-plugin to invoke Enunciate twice instead of trying to get Maven to do it. The configuration would look kinda like the contents of the "getting-started-examples" target at line 199 in build-site.xml.