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 20 package org.wurbelizer.maven; 21 22 import org.apache.maven.plugins.annotations.LifecyclePhase; 23 import org.apache.maven.plugins.annotations.Mojo; 24 import org.apache.maven.plugins.annotations.Parameter; 25 import org.apache.maven.plugins.annotations.ResolutionScope; 26 27 import java.io.File; 28 29 /** 30 * Wurbel sources.<br> 31 * Scans the sources for @wurblet anchors and executes the wurblets. 32 * The generated code from the wurblets is merged into the sources. 33 * 34 * @author harald 35 */ 36 @Mojo(name = "wurbel", 37 defaultPhase = LifecyclePhase.PROCESS_SOURCES, 38 configurator = "set-classrealm", 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 preceeding 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 }