You could always put it in a separate Maven project and declare a dependency to that artifact for the exec plugin. But then it might be better to create a Maven plugin instead... If it's something simple, why not just write a Groovy script and use the gmaven-plugin to execute it? You'll then keep it separate from your Java code, which is what you want.
/Anders On Thu, Mar 31, 2011 at 23:53, Andrew Robinson <[email protected] > wrote: > It is sometimes very convenient to have a java class with a main method > used > to help build a maven project, but one that is so specific to that project > that it is too large of an overhead to author it as a reusable maven > plugin. > > Using maven-exec-plugin, the class can be run, but then the question > becomes > who will compile it? Since the class is only used by the build, it should > not be included in the produced artifact (jar, war, etc), but the > maven-compiler-plugin is not written to taken configured source and > destination directories, only to use project-wide directories. > > Is there a better solution than to just filter the classes out of the built > artifact, or another way to build code to be used like a plugin, but > without > the full need to support the plugin as a reusable tool? >
