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,6 +116,8 @@ public class IdeaMojo
Xpp3Dom component = findComponent( module, "ProjectModuleManager" ); Xpp3Dom component = findComponent( module, "ProjectModuleManager" );
Xpp3Dom modules = findElement( component, "modules" ); Xpp3Dom modules = findElement( component, "modules" );
if ( project.getCollectedProjects().size() > 0 )
{
removeOldElements( modules, "module" ); removeOldElements( modules, "module" );
for ( Iterator i = project.getCollectedProjects().iterator(); i.hasNext(); ) for ( Iterator i = project.getCollectedProjects().iterator(); i.hasNext(); )
@ -126,6 +128,13 @@ public class IdeaMojo
String modulePath = new File( p.getBasedir(), p.getArtifactId() + ".iml" ).getAbsolutePath(); String modulePath = new File( p.getBasedir(), p.getArtifactId() + ".iml" ).getAbsolutePath();
m.setAttribute( "filepath", "$PROJECT_DIR$/" + toRelative( project.getBasedir(), modulePath ) ); m.setAttribute( "filepath", "$PROJECT_DIR$/" + toRelative( project.getBasedir(), modulePath ) );
} }
}
else
{
Xpp3Dom m = createElement( modules, "module" );
String modulePath = new File( project.getBasedir(), project.getArtifactId() + ".iml" ).getAbsolutePath();
m.setAttribute( "filepath", "$PROJECT_DIR$/" + toRelative( project.getBasedir(), modulePath ) );
}
FileWriter writer = new FileWriter( projectFile ); FileWriter writer = new FileWriter( projectFile );
try try