1 package org.codehaus.mojo.rmic; 2 3 /* 4 * Copyright (c) 2004-2012, Codehaus.org 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 * this software and associated documentation files (the "Software"), to deal in 8 * the Software without restriction, including without limitation the rights to 9 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 * of the Software, and to permit persons to whom the Software is furnished to do 11 * so, subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be included in all 14 * copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 * SOFTWARE. 23 */ 24 25 import org.apache.maven.plugins.annotations.LifecyclePhase; 26 import org.apache.maven.plugins.annotations.Mojo; 27 import org.apache.maven.plugins.annotations.Parameter; 28 import org.apache.maven.plugins.annotations.ResolutionScope; 29 30 import java.io.File; 31 import java.util.List; 32 33 /** 34 * Compiles rmi stubs and skeleton classes from a remote implementation class. 35 * 36 * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a> 37 * @version $Id$ 38 */ 39 @Mojo( name = "rmic", defaultPhase = LifecyclePhase.PROCESS_CLASSES, 40 requiresDependencyResolution = ResolutionScope.COMPILE ) 41 public class RmicMojo 42 extends AbstractRmiMojo 43 { 44 /** 45 * Specifies where to place rmic generated class files. If the generated files 46 * need to be included in the main project artifact, this parameter can be set 47 * to ${project.build.outputDirectory}. 48 */ 49 @Parameter( defaultValue = "${project.build.directory}/rmi-classes" ) 50 private File outputDirectory; 51 52 /** 53 * Directory tree where the compiled Remote classes are located. 54 */ 55 @Parameter( defaultValue = "${project.build.outputDirectory}" ) 56 private File classesDirectory; 57 58 /** 59 * Compile classpath of the maven project. 60 */ 61 @Parameter( defaultValue = "${project.compileClasspathElements}", readonly = true ) 62 private List<String> projectCompileClasspathElements; 63 64 /** 65 * Get the directory where rmic generated class files are written. 66 * 67 * @return the directory 68 */ 69 public File getOutputDirectory() 70 { 71 return outputDirectory; 72 } 73 74 /** 75 * Get the directory where the project classes are located. 76 * 77 * @return The project classes directory. 78 */ 79 public File getClassesDirectory() 80 { 81 return classesDirectory; 82 } 83 84 /** 85 * Get the list of classpath elements for the project. 86 * 87 * @return A list containing the project classpath elements. 88 */ 89 public List<String> getProjectClasspathElements() 90 { 91 return projectCompileClasspathElements; 92 } 93 94 public RmicMojo() 95 { 96 } 97 98 public RmicMojo( DependenciesFacade dependencies ) 99 { 100 super( dependencies ); 101 } 102 }