You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dennis Lundberg (JIRA)" <ji...@codehaus.org> on 2007/07/14 00:19:13 UTC

[jira] Commented: (MIDEA-100) Module file (.iml) is generated in a way that sources and javadocs are not recognized by Intellij Idea

    [ http://jira.codehaus.org/browse/MIDEA-100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_102223 ] 

Dennis Lundberg commented on MIDEA-100:
---------------------------------------

I just tried this on another project and I can not reproduce what you describe. I only get one SOURCES and one JAVADOC tag per dependency/module-library. Did you check the .iml file *before* opening it in IDEA?

Please supply a sample project that can be used to illustrate the problem.

> Module file (.iml) is generated in a way that sources and javadocs are not recognized by Intellij Idea
> ------------------------------------------------------------------------------------------------------
>
>                 Key: MIDEA-100
>                 URL: http://jira.codehaus.org/browse/MIDEA-100
>             Project: Maven 2.x IDEA Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: WIndows XP, Maven 2.0.7, Java 1.6, IntelliJ IDEA 7.0M1b
>            Reporter: Gerhard Mueller
>            Priority: Critical
>
> When a new iml file is generated with mvn idea:idea  -DdownloadSources=true -DdownloadJavadocs=true
> the generated .iml-file contains invalid entries for the javadocs and sources, like in this example:
>     <orderEntry type="module-library">
>       <library> 
>         <JAVADOC/>  
>         <SOURCES/>  
>         <CLASSES>
>           <root url="jar://C:/Dokumente und Einstellungen/muellerg/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar!/" />
>         </CLASSES>
>         <SOURCES>
>           <root url="jar://C:/Dokumente und Einstellungen/muellerg/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar!/" />
>         </SOURCES>
>         <JAVADOC>
>           <root url="jar://C:/Dokumente und Einstellungen/muellerg/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-javadoc.jar!/" />
>         </JAVADOC>
>       </library> 
>     </orderEntry>
> Removing the empty 
>         <JAVADOC/>  
>         <SOURCES/>  
> entries allows me to see the sources, but this is not a good solution.
> By looking at the source code https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java
> the reason might be the method
>     private Element createOrGetElement( Element lib, String name )
>     {
>         Element el = lib.element( "name" );
>         if ( el == null )
>         {
>             el = createElement( lib, name );
>         }
>         return el;
>     }
> In my opinion, the method should look like this:
>  
>     private Element createOrGetElement( Element lib, String name )
>     {
>         Element el = lib.element(  name  ); // CHANGE DONE HERE
>         if ( el == null )
>         {
>             el = createElement( lib, name );
>         }
>         return el;
>     }
> as otherwiese ALWAYS new element instances are created, regardless the provided name to look for,

-- 
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