Class IdeaProjectMojo

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

    public class IdeaProjectMojo
    extends AbstractIdeaMojo
    Creates the project file (*.ipr) for IntelliJ IDEA.
    • Constructor Summary

      Constructors 
      Constructor Description
      IdeaProjectMojo()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()
      Create IDEA (.ipr) project files.
      void initParam​(org.apache.maven.project.MavenProject project, org.apache.maven.artifact.factory.ArtifactFactory artifactFactory, org.apache.maven.artifact.repository.ArtifactRepository localRepo, org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver, org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource, org.apache.maven.plugin.logging.Log log, boolean overwrite, java.lang.String jdkName, java.lang.String jdkLevel, java.lang.String wildcardResourcePatterns, java.lang.String ideaVersion, java.util.Set macros)  
      void rewriteProject()  
      private void setJdkName​(org.dom4j.Element content, java.lang.String jdkName)
      Sets the name of the JDK to use.
      private void setWildcardResourcePatterns​(org.dom4j.Element content, java.lang.String wildcardResourcePatterns)
      Sets the wilcard resource patterns.
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

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

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

      • jdkName

        private java.lang.String jdkName
        Specify the name of the registered IDEA JDK to use for the project.
      • jdkLevel

        private java.lang.String jdkLevel
        Specify the version of the JDK to use for the project for the purpose of enabled assertions and Java 5.0 language features. The default value is the specification version of the executing JVM.
      • wildcardResourcePatterns

        private java.lang.String wildcardResourcePatterns
        Specify the resource pattern in wildcard format, for example "?*.xml;?*.properties". Currently supports 4.x and 5.x. Because IDEA doesn't distinguish between source and resources directories, this is needed. The default value corresponds to any file without a java extension. Please note that the default value includes package.html files as it's not possible to exclude those.
      • ideaVersion

        private java.lang.String ideaVersion
        Specify the version of IDEA to target. This is needed to identify the default formatting of project-jdk-name used by IDEA. Currently supports 4.x and 5.x.

        This will only be used when parameter jdkName is not set.

      • macros

        private java.util.Set macros
    • Constructor Detail

      • IdeaProjectMojo

        public IdeaProjectMojo()
    • Method Detail

      • initParam

        public void initParam​(org.apache.maven.project.MavenProject project,
                              org.apache.maven.artifact.factory.ArtifactFactory artifactFactory,
                              org.apache.maven.artifact.repository.ArtifactRepository localRepo,
                              org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver,
                              org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource,
                              org.apache.maven.plugin.logging.Log log,
                              boolean overwrite,
                              java.lang.String jdkName,
                              java.lang.String jdkLevel,
                              java.lang.String wildcardResourcePatterns,
                              java.lang.String ideaVersion,
                              java.util.Set macros)
      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Create IDEA (.ipr) project files.
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • rewriteProject

        public void rewriteProject()
                            throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • setJdkName

        private void setJdkName​(org.dom4j.Element content,
                                java.lang.String jdkName)
        Sets the name of the JDK to use.
        Parameters:
        content - Xpp3Dom element.
        jdkName - Name of the JDK to use.
      • setWildcardResourcePatterns

        private void setWildcardResourcePatterns​(org.dom4j.Element content,
                                                 java.lang.String wildcardResourcePatterns)
        Sets the wilcard resource patterns.
        Parameters:
        content - Xpp3Dom element.
        wildcardResourcePatterns - The wilcard resource patterns.