mirror of https://github.com/apache/maven.git
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:
parent
090ff06b76
commit
4361a69db0
|
@ -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 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue