1 /* 2 * Wurbelizer - https://wurbelizer.org 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 */ 18 19 package org.wurbelizer.maven; 20 21 import org.apache.maven.plugins.annotations.LifecyclePhase; 22 import org.apache.maven.plugins.annotations.Mojo; 23 import org.apache.maven.plugins.annotations.Parameter; 24 import org.apache.maven.plugins.annotations.ResolutionScope; 25 26 import java.io.File; 27 28 /** 29 * Wurbel sources.<br> 30 * Scans the sources for @wurblet anchors and executes the wurblets. 31 * The generated code from the wurblets is merged into the sources. 32 * 33 * @author harald 34 */ 35 @Mojo(name = "wurbel", 36 defaultPhase = LifecyclePhase.PROCESS_SOURCES, 37 configurator = "set-classrealm", 38 threadSafe = true, 39 requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME) 40 public class WurbelMojo extends AbstractWurbelMojo { 41 42 /** 43 * Directory holding the sources to be wurbelized.<br> 44 * Defaults to all java sources of the current project. 45 * If this is not desired, filesets must be used. 46 */ 47 @Parameter(defaultValue = "${project.build.sourceDirectory}", 48 property = "wurbel.sourceDir", 49 required = true) 50 private File sourceDir; 51 52 /** 53 * Directory for additional files generated by preceding phases 54 * provided for wurblets. 55 */ 56 @Parameter(defaultValue = "${project.build.directory}/analyze", 57 property = "wurbel.analyzeDir", 58 required = true) 59 private File analyzeDir; 60 61 @Override 62 public File getSourceDir() { 63 return sourceDir; 64 } 65 66 @Override 67 public File getAnalyzeDir() { 68 return analyzeDir; 69 } 70 71 }