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?