pax_global_header00006660000000000000000000000064120347644610014521gustar00rootroot0000000000000052 comment=b5c35ff6dece554f97a79f0697d976c3bde91a96 maven-annotation-plugin-maven-processor-plugin-2.0.8/000077500000000000000000000000001203476446100227175ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/.gitignore000066400000000000000000000002271203476446100247100ustar00rootroot00000000000000<<<<<<< HEAD .classpath .project .settings/ branch.sh release.sh sign-and-deploy.sh ======= /target/ >>>>>>> bf958dd87dd0dcd79c32815f3cdbafbfc8f350a5 maven-annotation-plugin-maven-processor-plugin-2.0.8/pom.xml000066400000000000000000000233341203476446100242410ustar00rootroot00000000000000 4.0.0 org.bsc.maven maven-processor-plugin maven-plugin 2.0.8 maven-processor-plugin - ${project.version} A maven plugin to process annotation for jdk6 at compile time This plugin helps to use from maven the new annotation processing provided by JDK6 integrated in java compiler This plugin could be considered the 'alter ego' of maven apt plugin http://mojo.codehaus.org/apt-maven-plugin/ http://code.google.com/p/maven-annotation-plugin/ org.apache.maven.plugins maven-plugin-plugin 2.5.1 ${release.repo.id} ${release.repo.url} ${snapshot.repo.id} ${snapshot.repo.url} false ${release.site.id} ${release.site.url} sonatype-repo https://oss.sonatype.org/content/repositories/snapshots sonatype-repo https://oss.sonatype.org/service/local/staging/deploy/maven2 svn:https://maven-annotation-plugin.googlecode.com/svn/docs google-project 1.3.1 scm:git:https://bartolomeo.sorrentino@code.google.com/p/maven-annotation-plugin/ scm:git:https://bartolomeo.sorrentino@code.google.com/p/maven-annotation-plugin/ https://bartolomeo.sorrentino@code.google.com/p/maven-annotation-plugin/ 2009 bartolomeo.sorrentino@gmail.com Bartolomeo Sorrentino GMT+1 Owner igor.vay...@gmail.com Igor Vaynberg Committer GNU LESSER GENERAL PUBLIC LICENSE http://www.gnu.org/licenses/lgpl.html org.apache.maven maven-plugin-api 3.0.1 org.apache.maven maven-core 3.0.1 junit junit 4.8.2 test org.apache.maven.plugins maven-compiler-plugin 2.3.2 1.5 1.5 maven-plugin-plugin 2.6 org.jvnet.wagon-svn wagon-svn 1.8 release org.apache.maven.plugins maven-gpg-plugin 1.3 sign-artifacts verify sign twitter com.vineetmanohar maven-twitter-plugin 0.1 New release ${project.version} of maven-annotation-plugin is available - http://code.google.com/p/maven-annotation-plugin deploy deploy tweet confluence org.apache.maven.plugins maven-site-plugin 3.0 org.bsc.maven maven-confluence-reporting-plugin 3.1.4-SNAPSHOT confluence http://localhost:8090/rpc/xmlrpc ds Tutorial admin plugin-confluence-summary maven-annotation-plugin-maven-processor-plugin-2.0.8/src/000077500000000000000000000000001203476446100235065ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/main/000077500000000000000000000000001203476446100244325ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/main/java/000077500000000000000000000000001203476446100253535ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/main/java/org/000077500000000000000000000000001203476446100261425ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/main/java/org/bsc/000077500000000000000000000000001203476446100267115ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/main/java/org/bsc/maven/000077500000000000000000000000001203476446100300175ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/main/java/org/bsc/maven/plugin/000077500000000000000000000000001203476446100313155ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/main/java/org/bsc/maven/plugin/processor/000077500000000000000000000000001203476446100333345ustar00rootroot00000000000000AbstractAnnotationProcessorMojo.java000066400000000000000000000405501203476446100424470ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/main/java/org/bsc/maven/plugin/processor/* * Copyright (C) 2009 2010 2011 Bartolomeo Sorrentino * * This file is part of maven-annotation-plugin. * * maven-annotation-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * maven-annotation-plugin is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with maven-annotation-plugin. If not, see . */ package org.bsc.maven.plugin.processor; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import javax.tools.JavaCompiler.CompilationTask; import javax.tools.*; import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; /** * * @author bsorrentino * * @threadSafe */ public abstract class AbstractAnnotationProcessorMojo extends AbstractMojo { /** * @parameter expression = "${project}" * @readonly * @required */ //@MojoParameter(expression = "${project}", readonly = true, required = true) protected MavenProject project; /** * @parameter expression="${plugin.artifacts}" * @readonly */ //@MojoParameter(expression="${plugin.artifacts}", readonly = true ) private java.util.List pluginArtifacts; /** * Specify the directory where to place generated source files (same behaviour of -s option) * @parameter * */ //@MojoParameter(required = false, description = "Specify the directory where to place generated source files (same behaviour of -s option)") private File outputDirectory; /** * Annotation Processor FQN (Full Qualified Name) - when processors are not specified, the default discovery mechanism will be used * @parameter * */ //@MojoParameter(required = false, description = "Annotation Processor FQN (Full Qualified Name) - when processors are not specified, the default discovery mechanism will be used") private String[] processors; /** * Additional compiler arguments * @parameter * */ //@MojoParameter(required = false, description = "Additional compiler arguments") private String compilerArguments; /** * Additional processor options (see javax.annotation.processing.ProcessingEnvironment#getOptions() * @parameter alias="options" * */ private java.util.Map optionMap; /** * Controls whether or not the output directory is added to compilation * @parameter */ //@MojoParameter(required = false, description = "Controls whether or not the output directory is added to compilation") private Boolean addOutputDirectoryToCompilationSources; /** * Indicates whether the build will continue even if there are compilation errors; defaults to true. * @parameter default-value="true" expression = "${annotation.failOnError}" * @required */ //@MojoParameter(required = true, defaultValue = "true", expression = "${annotation.failOnError}", description = "Indicates whether the build will continue even if there are compilation errors; defaults to true.") private Boolean failOnError = true; /** * Indicates whether the compiler output should be visible, defaults to true. * * @parameter expression = "${annotation.outputDiagnostics}" default-value="true" * @required */ //@MojoParameter(required = true, defaultValue = "true", expression = "${annotation.outputDiagnostics}", description = "Indicates whether the compiler output should be visible, defaults to true.") private boolean outputDiagnostics = true; /** * System properties set before processor invocation. * @parameter * */ //@MojoParameter(required = false, description = "System properties set before processor invocation.") private java.util.Map systemProperties; /** * includes pattern * @parameter */ //@MojoParameter( description="includes pattern") private String[] includes; /** * excludes pattern * @parameter */ //@MojoParameter( description="excludes pattern") private String[] excludes; private static final Lock syncExecutionLock = new ReentrantLock(); /** * additional source directories for the annotation processors. * @parameter */ private File[] additionalSourceDirectories; public File[] getAdditionalSourceDirectories() { if( additionalSourceDirectories == null ) { additionalSourceDirectories = new File[0]; } return additionalSourceDirectories; } /** * * @return supported source directories */ protected abstract java.util.Set getSourceDirectories(); /** * * @return output folder */ protected abstract File getOutputClassDirectory(); /** * * @param project * @param dir */ protected abstract void addCompileSourceRoot(MavenProject project, String dir); /** * * @return */ public abstract File getDefaultOutputDirectory(); private String buildProcessor() { if (processors == null || processors.length == 0) { return null; } StringBuilder result = new StringBuilder(); int i = 0; for (i = 0; i < processors.length - 1; ++i) { result.append(processors[i]).append(','); } result.append(processors[i]); return result.toString(); } protected abstract java.util.Set getClasspathElements( java.util.Set result ); private String buildCompileClasspath() { java.util.Set pathElements = new java.util.LinkedHashSet(); if( pluginArtifacts!=null ) { for( Artifact a : pluginArtifacts ) { if( "compile".equalsIgnoreCase(a.getScope()) || "runtime".equalsIgnoreCase(a.getScope()) ) { java.io.File f = a.getFile(); if( f!=null ) pathElements.add( a.getFile().getAbsolutePath() ); } } } getClasspathElements(pathElements); StringBuilder result = new StringBuilder(); for( String elem : pathElements ) { result.append(elem).append(File.pathSeparator); } return result.toString(); } /** * */ public void execute() throws MojoExecutionException { if ("pom".equalsIgnoreCase(project.getPackaging())) // Issue 17 { return; } syncExecutionLock.lock(); try { executeWithExceptionsHandled(); } catch (Exception e1) { super.getLog().error("error on execute: " + e1.getMessage()); if (failOnError) { throw new MojoExecutionException("Error executing", e1); } } finally { syncExecutionLock.unlock(); } } @SuppressWarnings("unchecked") private void executeWithExceptionsHandled() throws Exception { if (outputDirectory == null) { outputDirectory = getDefaultOutputDirectory(); } ensureOutputDirectoryExists(); addOutputToSourcesIfNeeded(); // new Debug(project).printDebugInfo(); final String includesString = ( includes==null || includes.length==0) ? "**/*.java" : StringUtils.join(includes, ","); final String excludesString = ( excludes==null || excludes.length==0) ? null : StringUtils.join(excludes, ","); java.util.Set sourceDirs = getSourceDirectories(); if( sourceDirs == null ) throw new IllegalStateException("getSourceDirectories is null!"); if( additionalSourceDirectories != null && additionalSourceDirectories.length>0) { sourceDirs.addAll( Arrays.asList((File[])additionalSourceDirectories) ); } List files = new java.util.ArrayList(); for( File sourceDir : sourceDirs ) { getLog().debug( String.format( "processing source directory [%s]", sourceDir.getPath()) ); if( sourceDir==null ) { getLog().warn( "source directory is null! Processor task will be skipped!" ); continue; } if( !sourceDir.exists() ) { getLog().warn( String.format("source directory [%s] doesn't exist! Processor task will be skipped!", sourceDir.getPath())); continue; } if( !sourceDir.isDirectory() ) { getLog().warn( String.format("source directory [%s] is invalid! Processor task will be skipped!", sourceDir.getPath())); continue; } files.addAll( FileUtils.getFiles(sourceDir, includesString, excludesString) ); } Iterable< ? extends JavaFileObject> compilationUnits1 = null; String compileClassPath = buildCompileClasspath(); String processor = buildProcessor(); List options = new ArrayList(10); options.add("-cp"); options.add(compileClassPath); options.add("-proc:only"); addCompilerArguments(options); if (processor != null) { options.add("-processor"); options.add(processor); } else { getLog().info("No processors specified. Using default discovery mechanism."); } options.add("-d"); options.add(getOutputClassDirectory().getPath()); options.add("-s"); options.add(outputDirectory.getPath()); for (String option : options) { getLog().info("javac option: " + option); } DiagnosticListener dl = null; if (outputDiagnostics) { dl = new DiagnosticListener() { public void report(Diagnostic< ? extends JavaFileObject> diagnostic) { getLog().info("diagnostic " + diagnostic); } }; } else { dl = new DiagnosticListener() { public void report(Diagnostic< ? extends JavaFileObject> diagnostic) { } }; } if (systemProperties != null) { java.util.Set< Map.Entry> pSet = systemProperties.entrySet(); for ( Map.Entry e : pSet ) { getLog().info( String.format("set system property : [%s] = [%s]", e.getKey(), e.getValue() )); System.setProperty(e.getKey(), e.getValue()); } } //compileLock.lock(); try { JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); if( compiler==null ) { getLog().error("JVM is not suitable for processing annotation! ToolProvider.getSystemJavaCompiler() is null."); return; } StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null); if( files!=null && !files.isEmpty() ) { compilationUnits1 = fileManager.getJavaFileObjectsFromFiles(files); } else { getLog().warn( "no source file(s) detected! Processor task will be skipped"); return; } CompilationTask task = compiler.getTask( new PrintWriter(System.out), fileManager, dl, options, null, compilationUnits1); /* * //Create a list to hold annotation processors LinkedList processors = new * LinkedList(); * * //Add an annotation processor to the list processors.add(p); * * //Set the annotation processor to the compiler task task.setProcessors(processors); */ // Perform the compilation task. if (!task.call()) { throw new Exception("error during compilation"); } } finally { //compileLock.unlock(); } } private List scanSourceDirectorySources(File sourceDir) throws IOException { if( sourceDir==null ) { getLog().warn( "source directory cannot be read (null returned)! Processor task will be skipped"); return null; } if( !sourceDir.exists() ) { getLog().warn( "source directory doesn't exist! Processor task will be skipped"); return null; } if( !sourceDir.isDirectory() ) { getLog().warn( "source directory is invalid! Processor task will be skipped"); return null; } final String includesString = ( includes==null || includes.length==0) ? "**/*.java" : StringUtils.join(includes, ","); final String excludesString = ( excludes==null || excludes.length==0) ? null : StringUtils.join(excludes, ","); List files = FileUtils.getFiles(sourceDir, includesString, excludesString); return files; } private void addCompilerArguments(List options) { if (!StringUtils.isEmpty(compilerArguments)) { for (String arg : compilerArguments.split(" ")) { if (!StringUtils.isEmpty(arg)) { arg = arg.trim(); getLog().info("Adding compiler arg: " + arg); options.add(arg); } } } if( optionMap!=null && !optionMap.isEmpty() ) { for( java.util.Map.Entry e : optionMap.entrySet() ) { if( !StringUtils.isEmpty(e.getKey()) && e.getValue()!=null ) { String opt = String.format("-A%s=%s", e.getKey().trim(), e.getValue().toString().trim()); options.add( opt ); getLog().info("Adding compiler arg: " + opt); } } } } private void addOutputToSourcesIfNeeded() { final Boolean add = addOutputDirectoryToCompilationSources; if (add == null || add.booleanValue()) { getLog().info("Source directory: " + outputDirectory + " added"); addCompileSourceRoot(project, outputDirectory.getAbsolutePath()); } } private void ensureOutputDirectoryExists() { final File f = outputDirectory; if (!f.exists()) { f.mkdirs(); } if( !getOutputClassDirectory().exists()) { getOutputClassDirectory().mkdirs(); } } } Debug.java000066400000000000000000000062221203476446100351500ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/main/java/org/bsc/maven/plugin/processor/* * Copyright (C) 2009 2010 2011 Bartolomeo Sorrentino * * This file is part of maven-annotation-plugin. * * maven-annotation-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * maven-annotation-plugin is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with maven-annotation-plugin. If not, see . */ package org.bsc.maven.plugin.processor; import java.io.File; import java.util.Collection; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.ArtifactUtils; import org.apache.maven.project.MavenProject; /** * Debug helpers */ class Debug { private final MavenProject project; public Debug(MavenProject project) { if (project == null) { throw new IllegalArgumentException("Argument 'project' cannot be null"); } this.project = project; } public void println(String name, Collection e) { System.out.println(name); if (null == e) { return; } for (T a : e) { System.out.printf("\t[%s] %s\n", a.getClass().getName(), a.toString()); } } public void printDeps(String name, Collection dependencies) { System.out.println(name); for (org.apache.maven.model.Dependency d : dependencies) { System.out.printf("dependency [%s]\n", d.toString()); String versionlessKey = ArtifactUtils.versionlessKey(d.getGroupId(), d.getArtifactId()); Artifact artifact = (Artifact)project.getArtifactMap().get(versionlessKey); if (null != artifact) { File file = artifact.getFile(); System.out.printf("artifact [%s]\n", file.getPath()); } } } public void printDebugInfo() throws Exception //DependencyResolutionRequiredException { //println("project.getCompileClasspathElements", project.getCompileClasspathElements()); println("project.getCompileArtifacts", project.getCompileArtifacts()); println("project.getCompileDependencies", project.getCompileDependencies()); println("project.getDependencyArtifacts", project.getDependencyArtifacts()); println("project.getArtifactMap", project.getArtifactMap().keySet()); println("project.getArtifacts", project.getArtifacts()); printDeps("project.getRuntimeDependencies", project.getRuntimeDependencies()); printDeps("project.getDependencies", project.getDependencies()); } } MainAnnotationProcessorMojo.java000066400000000000000000000073521203476446100415730ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/main/java/org/bsc/maven/plugin/processor/* * Copyright (C) 2009 2010 2011 Bartolomeo Sorrentino * * This file is part of maven-annotation-plugin. * * maven-annotation-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * maven-annotation-plugin is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with maven-annotation-plugin. If not, see . */ package org.bsc.maven.plugin.processor; import java.io.File; import java.util.List; import org.apache.maven.model.Resource; import org.apache.maven.project.MavenProject; /** * * @author bsorrentino * * @goal process * @requiresDependencyResolution compile * @phase generate-sources */ //@MojoGoal("process") //@MojoRequiresDependencyResolution(value = "compile") //@MojoPhase("generate-sources") public class MainAnnotationProcessorMojo extends AbstractAnnotationProcessorMojo { /** * project classpath * * @parameter expression = "${project.compileClasspathElements}" * @required * @readonly */ @SuppressWarnings("rawtypes") //@MojoParameter(expression = "${project.compileClasspathElements}", required = true, readonly = true) private List classpathElements; /** * project sourceDirectory * * @parameter expression = "${project.build.sourceDirectory}" * @required */ //@MojoParameter(expression = "${project.build.sourceDirectory}", required = true) private File sourceDirectory; /** * @parameter expression = "${project.build.directory}/generated-sources/apt" * @required */ //@MojoParameter(expression = "${project.build.directory}/generated-sources/apt", required = true) private File defaultOutputDirectory; /** * Set the destination directory for class files (same behaviour of -d option) * * @parameter expression="${project.build.outputDirectory}" */ //@MojoParameter(required = false, expression="${project.build.outputDirectory}", description = "Set the destination directory for class files (same behaviour of -d option)") private File outputClassDirectory; @Override public java.util.Set getSourceDirectories() { java.util.List sourceRoots = project.getCompileSourceRoots(); java.util.Set result = new java.util.HashSet( sourceRoots.size() + 1); result.add( sourceDirectory ); for( String s : sourceRoots ) { result.add( new File(s) ); } return result; } @Override protected File getOutputClassDirectory() { return outputClassDirectory; } protected void addCompileSourceRoot(MavenProject project, String dir) { project.addCompileSourceRoot(dir); } @Override public File getDefaultOutputDirectory() { return defaultOutputDirectory; } @Override @SuppressWarnings("unchecked") protected java.util.Set getClasspathElements( java.util.Set result) { List resources = project.getResources(); if( resources!=null ) { for( Resource r : resources ) { result.add(r.getDirectory()); } } result.addAll( classpathElements ); return result; } } TestAnnotationProcessorMojo.java000066400000000000000000000073571203476446100416330ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/main/java/org/bsc/maven/plugin/processor/* * Copyright (C) 2009 2010 2011 Bartolomeo Sorrentino * * This file is part of maven-annotation-plugin. * * maven-annotation-plugin is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * maven-annotation-plugin is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with maven-annotation-plugin. If not, see . */ package org.bsc.maven.plugin.processor; import java.io.File; import java.util.List; import org.apache.maven.model.Resource; import org.apache.maven.project.MavenProject; /** * * @author bsorrentino * * @goal process-test * @requiresDependencyResolution test * @phase generate-test-sources */ //@MojoGoal("process-test") //@MojoRequiresDependencyResolution(value = "test") //@MojoPhase("generate-test-sources") public class TestAnnotationProcessorMojo extends AbstractAnnotationProcessorMojo { /** * project classpath * * @parameter expression = "${project.testClasspathElements}" * @required * @readonly */ @SuppressWarnings("rawtypes") //@MojoParameter(expression = "${project.testClasspathElements}", required = true, readonly = true) private List classpathElements; /** * * @parameter expression = "${project.build.testSourceDirectory}" * @required */ //@MojoParameter(expression = "${project.build.testSourceDirectory}", required = true) private File sourceDirectory; /** * @parameter expression = "${project.build.directory}/generated-sources/apt-test" * @required */ //@MojoParameter(expression = "${project.build.directory}/generated-sources/apt-test", required = true) private File defaultOutputDirectory; /** * Set the destination directory for class files (same behaviour of -d option) * * @parameter expression="${project.build.testOutputDirectory}" */ //@MojoParameter(required = false, expression="${project.build.testOutputDirectory}", description = "Set the destination directory for class files (same behaviour of -d option)") private File outputClassDirectory; @Override public java.util.Set getSourceDirectories() { java.util.List sourceRoots = project.getCompileSourceRoots(); java.util.Set result = new java.util.HashSet( sourceRoots.size() + 1); result.add( sourceDirectory ); for( String s : sourceRoots ) { result.add( new File(s) ); } return result; } protected void addCompileSourceRoot(MavenProject project, String dir) { project.addTestCompileSourceRoot(dir); } @Override public File getDefaultOutputDirectory() { return defaultOutputDirectory; } @Override protected File getOutputClassDirectory() { return outputClassDirectory; } @SuppressWarnings("unchecked") @Override protected java.util.Set getClasspathElements( java.util.Set result ) { List resources = project.getTestResources(); if( resources!=null ) { for( Resource r : resources ) { result.add(r.getDirectory()); } } result.addAll( classpathElements ); return result; } } maven-annotation-plugin-maven-processor-plugin-2.0.8/src/main/resources/000077500000000000000000000000001203476446100264445ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/main/resources/COPYING.LESSER000066400000000000000000000167431203476446100305060ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. maven-annotation-plugin-maven-processor-plugin-2.0.8/src/site/000077500000000000000000000000001203476446100244525ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/site/apt/000077500000000000000000000000001203476446100252365ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/site/apt/usage.apt000066400000000000000000000125471203476446100270610ustar00rootroot00000000000000 Repository To use this plugin you have to include the following repository declaration in your POM +-------------------------------------------+ sonatype-repo https://oss.sonatype.org/content/repositories/snapshots false true +-------------------------------------------+ Usage <> Sources will be generated into target/generated-sources/apt/main/java Test sources into target/generated-sources/apt/test/java Both directories will be added to the compilation path +-------------------------------------------+ org.bsc.maven maven-processor-plugin process process generate-sources org.bsc.maven maven-processor-plugin process-test process-test generate-test-sources org.apache.maven.plugins maven-compiler-plugin -proc:none +-------------------------------------------+ <> Generating sources into src/main/generated directory. This strategy is good if you wish to check in your generated sources into your SCM. Run mvn generate-sources to generate the sources. +-------------------------------------------+ org.bsc.maven maven-processor-plugin process process generate-sources src/main/generated +-------------------------------------------+ <> Running specific annotation processors only. +-------------------------------------------+ org.bsc.maven maven-processor-plugin process process generate-sources org.bsc.apt.BeanInfoAnnotationProcessor +-------------------------------------------+ <> Passing options to processors +-------------------------------------------+ org.bsc.maven maven-processor-plugin process process generate-sources -Amyoption=TRUE TRUE +-------------------------------------------+ <> Set System Properties +-------------------------------------------+ org.bsc.maven maven-processor-plugin process process generate-sources true +-------------------------------------------+ maven-annotation-plugin-maven-processor-plugin-2.0.8/src/site/site.xml000066400000000000000000000027151203476446100261450ustar00rootroot00000000000000 maven-annotation-plugin-maven-processor-plugin-2.0.8/src/test/000077500000000000000000000000001203476446100244655ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/test/java/000077500000000000000000000000001203476446100254065ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/test/java/org/000077500000000000000000000000001203476446100261755ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/test/java/org/bsc/000077500000000000000000000000001203476446100267445ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/test/java/org/bsc/maven/000077500000000000000000000000001203476446100300525ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/test/java/org/bsc/maven/plugin/000077500000000000000000000000001203476446100313505ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/test/java/org/bsc/maven/plugin/processor/000077500000000000000000000000001203476446100333675ustar00rootroot00000000000000ProcessorTest.java000066400000000000000000000017431203476446100367770ustar00rootroot00000000000000maven-annotation-plugin-maven-processor-plugin-2.0.8/src/test/java/org/bsc/maven/plugin/processor/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.bsc.maven.plugin.processor; import org.junit.Assert; import org.junit.Test; import org.hamcrest.core.*; /** * * @author softphone */ public class ProcessorTest { @Test public void testDuplicatePath() { String homeFolder = System.getProperty("user.home"); java.io.File f1 = new java.io.File( homeFolder ); java.io.File f2 = new java.io.File( homeFolder ); java.io.File f3 = new java.io.File( homeFolder, ".m2" ); java.util.Set fileSet = new java.util.HashSet(); fileSet.add( f1 ); fileSet.add( f2 ); Assert.assertThat( fileSet.size(), IsEqual.equalTo(1) ); fileSet.add( f2 ); fileSet.add(f3); Assert.assertThat( fileSet.size(), IsEqual.equalTo(2) ); } }