Class ModifyEE9ToEE8

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="modify-sources-ee9-to-ee8",
          defaultPhase=GENERATE_SOURCES,
          threadSafe=true)
    public class ModifyEE9ToEE8
    extends org.apache.maven.plugin.AbstractMojo
    Modify sources from EE9 project to be compiled with EE8 dependencies
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean addToCompileSourceRoot  
      private boolean moveDirectoryStructure
      move generated sources org/eclipse/jetty/ee9 to org/eclipse/jetty/ee8
      protected java.util.Set<java.lang.String> notTranslateStartsWith
      this is a list of String to not translate if starting with
      private java.io.File outputDirectory
      Location of the modified sources.
      protected org.apache.maven.project.MavenProject project
      Maven Project.
      private boolean skip  
      private java.io.File sourceProjectLocation
      Location of the project to convert.
      private boolean testSources  
      private static java.lang.ThreadLocal<java.lang.Boolean> TRANSLATE  
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Constructor Summary

      Constructors 
      Constructor Description
      ModifyEE9ToEE8()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static void changeEE9NameToEE8​(com.github.javaparser.ast.nodeTypes.NodeWithName n)  
      private static void changeEE9TypeToEE8​(com.github.javaparser.ast.nodeTypes.NodeWithType n)  
      static java.lang.String changeEE9TypeToEE8​(java.lang.String currentType)  
      void execute()  
      private java.lang.String replaceClassName​(java.lang.String previousClassName)  
      protected void setMoveDirectoryStructure​(boolean moveDirectoryStructure)  
      protected void setSourceProjectLocation​(java.io.File sourceProjectLocation)  
      private static boolean startsWith​(java.lang.String str, java.util.Collection<java.lang.String> startList)  
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sourceProjectLocation

        @Parameter(property="sourceProjectLocation",
                   required=true)
        private java.io.File sourceProjectLocation
        Location of the project to convert.
      • outputDirectory

        @Parameter(defaultValue="${project.build.directory}/generated-sources/ee8",
                   property="outputLocation",
                   required=true)
        private java.io.File outputDirectory
        Location of the modified sources.
      • skip

        @Parameter(property="jetty.modifysources.EE9toEE8.skip")
        private boolean skip
      • moveDirectoryStructure

        @Parameter(property="jetty.modifysources.EE9toEE8.moveDirectoryStructure")
        private boolean moveDirectoryStructure
        move generated sources org/eclipse/jetty/ee9 to org/eclipse/jetty/ee8
      • testSources

        @Parameter(property="jetty.modifysources.testSources")
        private boolean testSources
      • addToCompileSourceRoot

        @Parameter(property="jetty.modifysources.addToCompileSourceRoot")
        private boolean addToCompileSourceRoot
      • project

        @Parameter(defaultValue="${project}",
                   readonly=true)
        protected org.apache.maven.project.MavenProject project
        Maven Project.
      • notTranslateStartsWith

        @Parameter
        protected java.util.Set<java.lang.String> notTranslateStartsWith
        this is a list of String to not translate if starting with
      • TRANSLATE

        private static final java.lang.ThreadLocal<java.lang.Boolean> TRANSLATE
    • Constructor Detail

      • ModifyEE9ToEE8

        public ModifyEE9ToEE8()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • replaceClassName

        private java.lang.String replaceClassName​(java.lang.String previousClassName)
      • changeEE9NameToEE8

        private static void changeEE9NameToEE8​(com.github.javaparser.ast.nodeTypes.NodeWithName n)
      • changeEE9TypeToEE8

        private static void changeEE9TypeToEE8​(com.github.javaparser.ast.nodeTypes.NodeWithType n)
      • changeEE9TypeToEE8

        public static java.lang.String changeEE9TypeToEE8​(java.lang.String currentType)
        Parameters:
        currentType -
        Returns:
        will return null if there is nothing to change
      • startsWith

        private static boolean startsWith​(java.lang.String str,
                                          java.util.Collection<java.lang.String> startList)
      • setSourceProjectLocation

        protected void setSourceProjectLocation​(java.io.File sourceProjectLocation)
      • setMoveDirectoryStructure

        protected void setMoveDirectoryStructure​(boolean moveDirectoryStructure)