Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6371

Use ServiceLoader mechanism in JDK9 in maven plugins

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.5.2
    • None
    • None

    Description

      It'd be nice to be able to use the ServiceLoader mechanism in maven plugins when using JDK9:

       

      
      import org.apache.maven.plugin.AbstractMojo;
      
      public class MyMojo extends AbstractMojo {
      
          public void execute() throws MojoExecutionException {
      
              // this is empty
      
              Iterator<Tool> iterator = ServiceLoader.load(javax.tools.Tool.class).iterator();
          }
      }
      

       

      Work around is to use a different classloader.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jpoth John Poth
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: