o when dealing with a single project, make a module for that project.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163906 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2005-04-11 23:43:12 +00:00
parent 090ff06b76
commit 4361a69db0
1 changed files with 14 additions and 5 deletions

View File

@ -116,14 +116,23 @@ public class IdeaMojo
Xpp3Dom component = findComponent( module, "ProjectModuleManager" ); Xpp3Dom component = findComponent( module, "ProjectModuleManager" );
Xpp3Dom modules = findElement( component, "modules" ); Xpp3Dom modules = findElement( component, "modules" );
removeOldElements( modules, "module" ); if ( project.getCollectedProjects().size() > 0 )
for ( Iterator i = project.getCollectedProjects().iterator(); i.hasNext(); )
{ {
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" ); 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 ) ); m.setAttribute( "filepath", "$PROJECT_DIR$/" + toRelative( project.getBasedir(), modulePath ) );
} }