Uploaded image for project: 'Maven Plugin Tools'
  1. Maven Plugin Tools
  2. MPLUGIN-183

When setting useJava5 to true the generated code has warnings for Java 5 features

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7
    • 2.8
    • API
    • None

    Description

      If you set the parameter useJava5 to true, the generated HelpMojo has some code in it that is not Java 5 clean. If you turn on Xlint for maven-compiler-plugin you can see warnings when the HelpMojo is compiled.

      The configuration used:

        <build>
          <plugins>
            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                <source>1.5</source>
                <target>1.5</target>
                <compilerArgument>-Xlint:all</compilerArgument>
              </configuration>
            </plugin>
      
            <plugin>
              <artifactId>maven-plugin-plugin</artifactId>
              <version>2.7</version>
              <configuration>
                <useJava5>true</useJava5>
              </configuration>
            </plugin>
          </plugins>
        </build>
      

      Here's what the warnings look like when used in Maven Changes Plugin:

      [WARNING] \apache\maven\maven-changes-plugin\target\generated-sources\plugin\org\apache\maven\plugin\changes\HelpMojo.java:[697,29] [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
      [WARNING] \apache\maven\maven-changes-plugin\target\generated-sources\plugin\org\apache\maven\plugin\changes\HelpMojo.java:[723,17] [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
      

      Attachments

        Activity

          People

            dennisl@apache.org Dennis Lundberg
            dennisl@apache.org Dennis Lundberg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: