PR: MPIDEA-7, MPIDEA-10, MPIDEA-19

Submitted by: David Jencks
Reviewed by:  Brett Porter
(applied with modifications)
rollup of IDEA plugin fixes

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@189908 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
brett 2005-06-10 06:35:25 +00:00
parent dd134e7011
commit 56c00dd5a8
6 changed files with 96 additions and 30 deletions

View File

@ -117,6 +117,17 @@
<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}"
collectOnly="true"
collectionVar="mavenIdeaProjectList"
ignoreFailures="true"/>
<j:expr value="${context.getMavenSession().getRootContext().setVariable('mavenIdeaProjectList', context.getVariable('mavenIdeaProjectList'))}"/>
<maven:reactor
basedir="${multiprojectBasedir}"
banner="Generating idea module file for:"

View File

@ -82,9 +82,7 @@
<maven:get var="warSrc" plugin="maven-war-plugin" property="maven.war.src" />
<maven:makeRelativePath var="value" basedir="${basedir}" path="${warSrc}" separator="/" />
<webroots>
<!-- MPIDEA-15 -->
<root url="file://$$MODULE_DIR$$/${value}" relative="/" />
</webroots>
<orderEntriesWatcher>
<pairs>
@ -113,9 +111,9 @@
<component name="NewModuleRootManager">
<maven:makeRelativePath var="value" basedir="${basedir}" path="${maven.build.dest}" separator="/" />
<output url="file://$$MODULE_DIR$$/${value}"/>
<!-- @todo - use maven.test.dest instead -->
<maven:makeRelativePath var="value" basedir="${basedir}" path="${maven.build.dir}" separator="/" />
<output-test url="file://$$MODULE_DIR$$/${value}/test-classes"/>
<maven:pluginVar var="testOutputDir" plugin='maven-test-plugin' property='maven.test.dest'/>
<maven:makeRelativePath var="value" basedir="${basedir}" path="${testOutputDir}" separator="/"/>
<output-test url="file://$$MODULE_DIR$$/${value}"/>
<content url="file://$MODULE_DIR$">
<j:if test="${sourcesPresent}">
<maven:makeRelativePath var="value" basedir="${basedir}" path="${pom.build.sourceDirectory}" separator="/" />
@ -138,7 +136,12 @@
<excludeFolder url="file://$$MODULE_DIR$$/${value}"/>
</j:forEach>
</j:if>
<j:forEach var="genSource" items="${context.getVariable('maven.idea.generated.source')}">
<sourceFolder url="file://$$MODULE_DIR$$/target/${genSource}" isTestSource="false"/>
</j:forEach>
<maven:makeRelativePath var="defaulttargetdir" basedir="${basedir}" path="${maven.build.dir}" separator="/"/>
<excludeFolder url="file://$$MODULE_DIR$$/${defaulttargetdir}/classes"/>
<excludeFolder url="file://$$MODULE_DIR$$/${defaulttargetdir}/test-classes"/>
</content>
<orderEntry type="jdk" jdkName="java version &quot;${java.version}&quot;"/>
<!-- MPIDEA-11 (duplicates MPIDEA-22): Reference resources directory -->
@ -174,27 +177,41 @@
<orderEntry type="sourceFolder" forTests="false"/>
<j:forEach var="lib" items="${pom.artifacts}">
<j:set var="dep" value="${lib.dependency}"/>
<j:choose>
<j:when test="${dep.groupId == pom.groupId}" >
<!-- MPIDEA-7 -->
<orderEntry type="module" module-name="${dep.artifactId}" />
</j:when>
<j:otherwise>
<orderEntry type="module-library">
<library name="${dep.artifactId}">
<CLASSES>
<root url="jar://${lib.path}!/"/>
</CLASSES>
<JAVADOC/>
<SOURCES/>
</library>
</orderEntry>
</j:otherwise>
</j:choose>
<j:set var="isModule" value="false"/>
<j:forEach var="module" items="${context.getVariable('mavenIdeaProjectList')}">
<j:if test="${dep.groupId == module.groupId and dep.artifactId == module.artifactId}">
<orderEntry type="module" module-name="${dep.artifactId}" />
<j:set var="isModule" value="true"/>
<j:break/>
</j:if>
</j:forEach>
<j:if test="${isModule == 'false' and (dep.type=='jar' or dep.type=='ejb')}">
<orderEntry type="module-library">
<library name="${dep.artifactId}">
<CLASSES>
<root url="jar://${lib.path}!/"/>
</CLASSES>
<JAVADOC/>
<SOURCES/>
</library>
</orderEntry>
</j:if>
</j:forEach>
<j:if test="${unitTestSourcesPresent and pom.getDependency('junit') == null}">
<maven:pluginVar var="testPlugin" plugin='maven-test-plugin' property='plugin'/>
<j:set var="depVersion">${testPlugin.getDependency('junit').getVersion()}</j:set>
<j:if test="${depVersion != 'none'}">
<orderEntry type="module-library">
<library name="junit">
<CLASSES>
<root url="jar://${maven.repo.local}/junit/jars/junit-${depVersion}.jar!/"/>
</CLASSES>
<JAVADOC/>
<SOURCES/>
</library>
</orderEntry>
</j:if>
</j:if>
</component>
<component name="ModuleRootManager"/>
</module>

View File

@ -17,10 +17,24 @@
*/
-->
<j:whitespace xmlns:j="jelly:core" xmlns="dummy" trim="true">
<j:whitespace xmlns:j="jelly:core" xmlns:maven="jelly:maven" xmlns="dummy" trim="true">
<project version="4" relativePaths="false">
<component name="ProjectRootManager" version="2" assert-keyword="false"/>
<maven:get plugin="maven-java-plugin" property="maven.compile.source" var="jdkLevel" />
<j:if test="${empty(jdkLevel)}">
<j:set var="jdkLevel" value="${java.specification.version}" />
</j:if>
<j:choose>
<j:when test="${jdkLevel == '1.4'}">
<component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="false"/>
</j:when>
<j:when test="${jdkLevel.compareTo('1.5') >= 0}">
<component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true"/>
</j:when>
<j:otherwise>
<component name="ProjectRootManager" version="2" assert-keyword="false"/>
</j:otherwise>
</j:choose>
<component name="CodeStyleManager">
<option name="USE_DEFAULT_CODE_STYLE_SCHEME" value="true"/>
<option name="CODE_STYLE_SCHEME" value=""/>

View File

@ -17,10 +17,24 @@
*/
-->
<j:whitespace xmlns:j="jelly:core" xmlns="dummy" trim="true">
<j:whitespace xmlns:j="jelly:core" xmlns:maven="jelly:maven" xmlns="dummy" trim="true">
<project version="4" relativePaths="false">
<component name="ProjectRootManager" version="2" assert-keyword="false"/>
<maven:get plugin="maven-java-plugin" property="maven.compile.source" var="jdkLevel" />
<j:if test="${empty(jdkLevel)}">
<j:set var="jdkLevel" value="${java.specification.version}" />
</j:if>
<j:choose>
<j:when test="${jdkLevel == '1.4'}">
<component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="false"/>
</j:when>
<j:when test="${jdkLevel.compareTo('1.5') >= 0}">
<component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true"/>
</j:when>
<j:otherwise>
<component name="ProjectRootManager" version="2" assert-keyword="false"/>
</j:otherwise>
</j:choose>
<component name="CodeStyleManager">
<option name="USE_DEFAULT_CODE_STYLE_SCHEME" value="true"/>
<option name="CODE_STYLE_SCHEME" value=""/>

View File

@ -25,6 +25,9 @@
</properties>
<body>
<release version="1.6-SNAPSHOT" date="in SVN">
<action dev="brett" type="fix" issue="MPIDEA-7" due-to="David Jencks">Make projects within the reactor set IDEA module dependencies, but keep all others as JAR dependencies</action>
<action dev="brett" type="fix" issue="MPIDEA-10" due-to="David Jencks">Add a property for specifying generated source directories to include in the module</action>
<action dev="brett" type="fix" issue="MPIDEA-19">Set source level properties based on the compile source level</action>
<action dev="brett" type="fix" issue="MPIDEA-9" due-to="Eirik Bjorsnos">Deployment descriptor for ejb.jar hard-coded</action>
<action dev="brett" type="fix" issue="MPIDEA-15" due-to="Geoffrey De Smet">v4/module.jelly generates incorrect references to $MODULE_DIR$</action>
<action dev="brett" type="add" issue="MPIDEA-28" due-to="Geoffrey De Smet">Generate a module for the multiproject itself</action>

View File

@ -80,6 +80,13 @@
Default value is ${maven.multiproject.basedir}
</td>
</tr>
<tr>
<td>maven.idea.generated.source</td>
<td>Yes</td>
<td>
Comma separated list of directories under target containing generated source to be included in the idea module. Common examples would be xmlbeans or xdoclet generated code.
</td>
</tr>
<tr>
<td>maven.idea.target.exclude</td>
<td>Yes</td>