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

generatedSourcesDirectory should be included in list provided by org.apache.maven.project.MavenProject.getCompileClasspathElements()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.2
    • 3.2
    • None

    Description

      I'm using a plugin (gwt-maven-plugin) that needs to know where all of my project's source code is, including generated sources. The standard compiler plugin (maven-compiler-plugin, v2.3.2) generates the sources correctly (from anntotations) and uses the generated code fine when compiling my project. But to get the gwt-maven-plugin to find the generated sources, I have to use the build-helper-maven-plugin to add the generated sources directory, as shown here:

      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>2.3.2</version>
      <configuration>
      <source>1.6</source>
      <target>1.6</target>
      <generatedSourcesDirectory>${project.build.directory}/generated-sources/apt</generatedSourcesDirectory>
      </configuration>
      </plugin>
      <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>build-helper-maven-plugin</artifactId>
      <version>1.5</version>
      <executions>
      <execution>
      <id>add-source</id>
      <phase>generate-sources</phase>
      <goals>
      <goal>add-source</goal>
      </goals>
      <configuration>
      <sources>
      <source>${project.build.directory}/generated-sources/apt</source>
      </sources>
      </configuration>
      </execution>
      </executions>
      </plugin>

      It shouldn't be necessary to use build-helper-maven-plugin here; the generated sources should automatically be on the classpath. As far as I can tell, this is a Maven issue, or perhaps a maven-compiler-plugin issue, and is not the fault of gwt-maven-plugin.

      Attachments

        Issue Links

          Activity

            People

              jdcasey John Dennis Casey
              andrew.green.df Andrew Green
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: