It creates the idea module files (.iml) via reactor and main project which aggregates this modules. Each module has it's own classpath, src and test, traget dir setting etc. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114582 13f79535-47bb-0310-9956-ffa450edef68
115 lines
4.3 KiB
XML
115 lines
4.3 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<project xmlns:j="jelly:core"
|
|
xmlns:ant="jelly:ant"
|
|
xmlns:util="jelly:util"
|
|
xmlns:maven="jelly:maven">
|
|
|
|
<!--==================================================================-->
|
|
<!-- Generate IntelliJ IDEA project, workspace and model files -->
|
|
<!--==================================================================-->
|
|
<goal name="idea"
|
|
description="Generate IDEA project files"
|
|
prereqs="idea:idea"/>
|
|
|
|
<goal name="idea:init">
|
|
<j:set var="template.dir" value="${plugin.resources}/templates/v${maven.idea.project.version}"/>
|
|
</goal>
|
|
|
|
|
|
<goal name="idea:project"
|
|
description="Generate IDEA .ipr project files"
|
|
prereqs="idea:init">
|
|
<ant:echo>Creating ${basedir}/${pom.artifactId}.ipr ...</ant:echo>
|
|
|
|
<j:file name="${basedir}/${pom.artifactId}.ipr" prettyPrint="true" xmlns="dummy">
|
|
<j:import file="${template.dir}/project.jelly" inherit="true"/>
|
|
</j:file>
|
|
|
|
</goal>
|
|
|
|
|
|
<goal name="idea:workspace"
|
|
description="Generate IDEA .iws project files"
|
|
prereqs="idea:init">
|
|
<ant:echo>Creating ${basedir}/${pom.artifactId}.iws ...</ant:echo>
|
|
|
|
<j:file name="${basedir}/${pom.artifactId}.iws" prettyPrint="true" xmlns="dummy">
|
|
<j:import file="${template.dir}/workspace.jelly" inherit="true"/>
|
|
</j:file>
|
|
</goal>
|
|
|
|
<!-- -->
|
|
<goal name="idea:idea"
|
|
description="Generate IDEA .ipr, .iml and .iws project files">
|
|
<attainGoal name="idea:project"/>
|
|
<attainGoal name="idea:workspace"/>
|
|
<attainGoal name="idea:module"/>
|
|
</goal>
|
|
|
|
<goal name="idea:module"
|
|
description="Generate IDEA .iml project files"
|
|
prereqs="idea:init">
|
|
<util:available file="${template.dir}/module.jelly">
|
|
<ant:echo>Creating ${basedir}/${pom.artifactId}.iml ...</ant:echo>
|
|
<j:file name="${basedir}/${pom.artifactId}.iml" prettyPrint="true" xmlns="dummy">
|
|
<j:import file="${template.dir}/module.jelly" inherit="true"/>
|
|
</j:file>
|
|
</util:available>
|
|
</goal>
|
|
|
|
|
|
<!--
|
|
|
|
|
|
-->
|
|
<goal name="idea:multiproject" prereqs="idea:init">
|
|
|
|
<j:set var="ideaVersion" value="${maven.idea.project.version}"/>
|
|
<j:if test="${ideaVersion=='3'}">
|
|
<ant:echo>WARNING: This goal should be used only with IDEA 4.</ant:echo>
|
|
<ant:echo>Property 'maven.idea.project.version' is set to '3'</ant:echo>
|
|
<!-- how to exist from goal? -->
|
|
</j:if>
|
|
|
|
|
|
<attainGoal name="idea:workspace"/>
|
|
|
|
<!-- Finding modules -->
|
|
<!-- we use plugin's own settings in first order. -->
|
|
<!-- if they are not provided we will try use use multiproject settings -->
|
|
<j:set var="multiprojectIncludes" value="${maven.idea.project.multiproject.includes}"/>
|
|
<j:if test="${multiprojectIncludes == null or multiprojectIncludes.length() eq 0}">
|
|
<maven:pluginVar var="multiprojectIncludes" plugin="maven-multiproject-plugin" property="maven.multiproject.includes"/>
|
|
</j:if>
|
|
|
|
<j:set var="multiprojectExcludes" value="${maven.idea.project.multiproject.excludes}"/>
|
|
<j:if test="${multiprojectExcludes == null or multiprojectExcludes.length() eq 0}">
|
|
<maven:pluginVar var="multiprojectExcludes" plugin="maven-multiproject-plugin" property="maven.multiproject.excludes"/>
|
|
</j:if>
|
|
|
|
|
|
<j:set var="multiprojectBasedir" value="${maven.idea.project.multiproject.basedir}"/>
|
|
<j:if test="${multiprojectBasedir == null or multiprojectBasedir.length() eq 0}">
|
|
<maven:pluginVar var="multiprojectBasedir" plugin="maven-multiproject-plugin" property="maven.multiproject.basedir"/>
|
|
</j:if>
|
|
|
|
|
|
<maven:reactor
|
|
basedir="${multiprojectBasedir}"
|
|
banner="Generating idea module file for:"
|
|
includes="${multiprojectIncludes}"
|
|
excludes="${multiprojectExcludes}"
|
|
postProcessing="true"
|
|
goals="idea:module"
|
|
ignoreFailures="true"/>
|
|
|
|
<ant:echo>Creating ${basedir}/${pom.artifactId}.ipr ...</ant:echo>
|
|
<j:file name="${basedir}/${pom.artifactId}.ipr" prettyPrint="true" xmlns="dummy">
|
|
<j:import file="${template.dir}/multiproject.jelly" inherit="true"/>
|
|
</j:file>
|
|
|
|
</goal>
|
|
|
|
</project>
|