Uploaded image for project: 'Maven Compiler Plugin'
  1. Maven Compiler Plugin
  2. MCOMPILER-134

add support for jdk 6 javac -processorpath parameter

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Auto Closed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 3.5
    • Labels:
      None

      Description

      add support for annotation processing javac option -processorpath
      cf. http://download.oracle.com/javase/6/docs/technotes/tools/windows/javac.html#processing

      while not supported, annotation processor classes have to be supplied via compile classpath.

      annotation processor dependencies (e.g. database, xml processing, ...) might not be wanted as project dependencies or event be in conflict with them.

      as a workaround I have attached new ProcCompilerMojo, where I tried to implement processorpath support
      1) via a new configuration option: dependency resolution is done with bits of code I copied from other maven classes like ProjectBuilder, ...

      <configuration>
      	<proc>only</proc>
      	<processorpath>
      		<dependency>
      			<groupId>org.slf4j</groupId>
      			<artifactId>slf4j-jdk14</artifactId>
      			<version>1.5.6</version>
      		</dependency>
      		<dependency>
      			<groupId>com.example</groupId>
      			<artifactId>annoproc</artifactId>
      			<version>1.0.0</version>
      		</dependency>
      	</processorpath>
      </configuration>
      

      2) (unused) via plugin dependencies: I basically make use of ProcCompilerMojo classloader urls. This variant is quite "dirty". it adds unnecessary maven plugin jars to annotation processor classpath and unnecessary annotation processor jars to compiler-plugin classpath

        Issue Links

          Activity

          Hide
          work_registries Jürgen added a comment -

          fixed in duplicate issue

          Show
          work_registries Jürgen added a comment - fixed in duplicate issue
          Hide
          michael-o Michael Osipov added a comment -

          This issue has been auto closed because it has been inactive for a long period of time. If you think this issue still applies, retest your problem with the most recent version of Maven and the affected component, reopen and post your results.

          Show
          michael-o Michael Osipov added a comment - This issue has been auto closed because it has been inactive for a long period of time. If you think this issue still applies, retest your problem with the most recent version of Maven and the affected component, reopen and post your results.
          Hide
          jglick Jesse Glick added a comment -

          Ideally you could define a <dependency> with <scope>processor</scope>, but Maven core seems to hardcode permitted scopes. The next best thing would be to the ability to specify dependency-like artifacts in the compiler plugin configuration.

          Show
          jglick Jesse Glick added a comment - Ideally you could define a <dependency> with <scope>processor</scope> , but Maven core seems to hardcode permitted scopes. The next best thing would be to the ability to specify dependency-like artifacts in the compiler plugin configuration.
          Hide
          work_registries Jürgen added a comment -

          first upload might have been corrupted ?

          Show
          work_registries Jürgen added a comment - first upload might have been corrupted ?

            People

            • Assignee:
              Unassigned
              Reporter:
              work_registries Jürgen
            • Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development