I have a library which is used via inline taglets. It's intended to be used by other libraries, for inserting example code into their JavaDoc.
The library is done, and, hallelujah, as of yesterday, it's now on Maven Central.
I'm now implementing this library into another project for the first time. That project compiles its code with java.version
1.5. But the taglet library requires 1.7. Not just for running javadoc.exe
, but also for compiling optional "taglet customizer" classes.
UPDATE: These customizer classes are created by each developer--the person using the taglet library in their library. The customizer classes (which are completely optional--they're needed only for advanced features, and you can get away with creating none) are required to be compiled before executing javadoc.exe
.
So it needs the following goals:
- Compile the main library classes (requires Java 1.5) (
mvn compile
) - Compile the customizers (requires Java 1.7) (
mvn compilecodelet
?) - Run
javadoc.exe
(Java 1.7) (`mvn docs'?)
mvn install
would therefore call these three goals in order.
I'm new to Maven, and would appreciate some advice on how to do this. This is what I've found out so far:
Here's the project's current compile
goal:
<properties>
<java.version>1.5</java.version>
</properties>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
It seems the JDK for this project should be upgraded to 1.7, with the main classes compiled with the <source>
and <target>
flags set to 1.5
, and the taglet-customizers compiled with those flags set to 1.7.
Some references:
maven-compiler-plugin
overview- Compiling Sources Using A Different JDK, but I believe the only JDK hi
How can I set up this extra compilecodelet
goal, and set the whole project up so it can handle both JDK versions? And so that mvn install
(and whatever other "master" goals) also call this new sub-goal in the proper sequence?
As I said, I'm new to Maven, and although I'm starting to understand bits and pieces, but I don't know how to put this all together yet.
Thank you for helping.