You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Geoffrey (JIRA)" <ji...@codehaus.org> on 2005/05/03 14:16:02 UTC

[jira] Commented: (MPIDEA-11) include maven project resources in module library

     [ http://jira.codehaus.org/browse/MPIDEA-11?page=comments#action_38453 ]
     
Geoffrey commented on MPIDEA-11:
--------------------------------

This patch might have a small problem which can be fixed.

The problem is that IntelliJ doesn't copy this lib directory into the target/classes directory.

Try the following:
A resource src/resources/myprops.props with a property "a = 1"
- Build with maven => myprops.props get copied into target/classes
- Run in Intellij: works perfectly
- change "a = 2"
- Make in IntelliJ => myprops.props doesn't get copied and in target/classes/myprops.props a is still 1
- Run in IntelliJ: target/classes is on the classpath before src/resources so a = 1 instead 2

Solution:
put the library for src/resource before <module source> in order/export tab in IntelliJ

> include maven project resources in module library
> -------------------------------------------------
>
>          Key: MPIDEA-11
>          URL: http://jira.codehaus.org/browse/MPIDEA-11
>      Project: maven-idea-plugin
>         Type: Improvement
>     Reporter: Matthew McGowan
>     Priority: Minor
>  Attachments: diff.txt
>
>
> Maven source and unit test resource directories are added to the module path, so they are picked up when running apps or unit tests directly from IDEA. 
> Index: src/plugin-resources/templates/v4/module.jelly
> ===================================================================
> RCS file: /home/cvspublic/maven-plugins/idea/src/plugin-resources/templates/v4/module.jelly,v
> retrieving revision 1.7
> diff -u -r1.7 module.jelly
> --- src/plugin-resources/templates/v4/module.jelly	23 Jun 2004 12:28:49 -0000	1.7
> +++ src/plugin-resources/templates/v4/module.jelly	28 Sep 2004 13:10:17 -0000
> @@ -122,6 +122,44 @@
>            <sourceFolder url="file://$$MODULE_DIR$$/${value}" isTestSource="true"/>
>          </j:if>
>        </content>
> +
> +        <j:forEach var="res" items="${pom.build.resources}">
> +			<orderEntry type="module-library">
> +			      <library>
> +			        <CLASSES>
> +	
> +<maven:makeRelativePath var="value" basedir="${basedir}"
> +path="${res.directory}" separator="/" />
> +						<root
> +url="file://$$MODULE_DIR$$/${value}"/>
> +			        </CLASSES>
> +			        <JAVADOC />
> +			        <SOURCES />
> +			      </library>
> +			    </orderEntry>            
> +		</j:forEach>      
> +          
> +	    <j:if test="${unitTestSourcesPresent == 'true'}">
> +		      <j:if test="${pom.build.unitTest != null}">
> +		      
> +	            <j:forEach var="res" items="${pom.build.unitTest.resources}">
> +					<orderEntry type="module-library">
> +					      <library>
> +					        <CLASSES>
> +			
> +	<maven:makeRelativePath var="value" basedir="${basedir}"
> +	path="${res.directory}" separator="/" />
> +								<root
> +	url="file://$$MODULE_DIR$$/${value}"/>
> +					        </CLASSES>
> +					        <JAVADOC />
> +					        <SOURCES />
> +					      </library>
> +				    </orderEntry>            
> +				</j:forEach>      
> +			</j:if>
> +		</j:if>
> +
>        <orderEntry type="jdk" jdkName="java version &quot;${java.version}&quot;"/>
>        <orderEntry type="sourceFolder" forTests="false"/>
>        <j:forEach var="lib" items="${pom.artifacts}">

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org