Generating Java from Apache Maven

<< Generating Java from the Shell | Generating Java from Apache Ant >>

To use jADT in Apache Maven you just need to put the plugin in your project's build plugins in your pom.xml.

    <project>
       ...
       <build>
          <plugins>
             ...
             <plugin>
                <groupId>com.pogofish.jadt</groupId>
                <artifactId>jADT-maven-plugin</artifactId>
                <version>0.3.0</version>
                <configuration>
                
                  <!-- Either a directory with .jadt files or the path
                       to a single file. Optional, defaults to src/main/jadt. -->
                  <!-- <srcFile>src/main/jadt/MyStuff.jadt</srcFile> -->
                  
                  <!-- Optional, defaults to target/generated-sources/jadt -->
                  <!-- <destDir>target/generated-sources/myjadtstuff</destDir> -->
                  
                </configuration>
                <executions>
                   <execution>
                      <goals>
                         <goal>jADT</goal>
                      </goals>
                    </execution>
                </executions>             
             </plugin>
             
          </plugins>
       </build>
    </project>

During the generate-sources phase (which automatically runs prior to the compile phase), Maven will produce the .java output files and add the desination directory to directories to be compiled. You can also explicitly execute jADT by running mvn jADT:jADT.

<< Generating Java from the Shell | Generating Java from Apache Ant >>