maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: maven-components/maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea IdeaMojo.java
Date Mon, 11 Apr 2005 23:43:13 GMT
jvanzyl     2005/04/11 16:43:13

  Modified:    maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea
                        IdeaMojo.java
  Log:
  o when dealing with a single project, make a module for that project.
  
  Revision  Changes    Path
  1.4       +14 -5     maven-components/maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java
  
  Index: IdeaMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-idea-plugin/src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- IdeaMojo.java	5 Apr 2005 08:20:28 -0000	1.3
  +++ IdeaMojo.java	11 Apr 2005 23:43:12 -0000	1.4
  @@ -116,14 +116,23 @@
               Xpp3Dom component = findComponent( module, "ProjectModuleManager" );
               Xpp3Dom modules = findElement( component, "modules" );
   
  -            removeOldElements( modules, "module" );
  -
  -            for ( Iterator i = project.getCollectedProjects().iterator(); i.hasNext();
)
  +            if ( project.getCollectedProjects().size() > 0 )
               {
  -                MavenProject p = (MavenProject) i.next();
  +                removeOldElements( modules, "module" );
  +
  +                for ( Iterator i = project.getCollectedProjects().iterator(); i.hasNext();
)
  +                {
  +                    MavenProject p = (MavenProject) i.next();
   
  +                    Xpp3Dom m = createElement( modules, "module" );
  +                    String modulePath = new File( p.getBasedir(), p.getArtifactId() + ".iml"
).getAbsolutePath();
  +                    m.setAttribute( "filepath", "$PROJECT_DIR$/" + toRelative( project.getBasedir(),
modulePath ) );
  +                }
  +            }
  +            else
  +            {
                   Xpp3Dom m = createElement( modules, "module" );
  -                String modulePath = new File( p.getBasedir(), p.getArtifactId() + ".iml"
).getAbsolutePath();
  +                String modulePath = new File( project.getBasedir(), project.getArtifactId()
+ ".iml" ).getAbsolutePath();
                   m.setAttribute( "filepath", "$PROJECT_DIR$/" + toRelative( project.getBasedir(),
modulePath ) );
               }
   
  
  
  

Mime
View raw message