Index: src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java =================================================================== --- src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java (revision 452786) +++ src/main/java/org/apache/maven/plugin/idea/IdeaModuleMojo.java (working copy) @@ -76,6 +76,15 @@ * @parameter expression="${linkModules}" default-value="true" */ private boolean linkModules; + + /** + * Whether to exclude certain reactor projects from inclusion as dependency modules. + * + * Default is empty, comma-seperated list of modules which should be excluded (they will be linked as jar-libraries instead). + * + * @parameter expression="${linkModulesExcept}" default-value="" + */ + private String linkModulesExcept; /** * @parameter expression="${deploymentDescriptorFile}" @@ -168,7 +177,7 @@ public void initParam( MavenProject project, ArtifactFactory artifactFactory, ArtifactRepository localRepo, ArtifactResolver artifactResolver, ArtifactMetadataSource artifactMetadataSource, Log log, boolean overwrite, MavenProject executedProject, List reactorProjects, - WagonManager wagonManager, boolean linkModules, boolean useFullNames, + WagonManager wagonManager, boolean linkModules, String linkModulesExcept, boolean useFullNames, boolean downloadSources, String sourceClassifier, boolean downloadJavadocs, String javadocClassifier, Library[] libraries, Set macros, String exclude, boolean useShortDependencyNames ) @@ -181,6 +190,8 @@ this.wagonManager = wagonManager; this.linkModules = linkModules; + + this.linkModulesExcept = linkModulesExcept; this.useFullNames = useFullNames; @@ -457,7 +468,8 @@ } boolean isIdeaModule = false; - if ( linkModules ) + + if ( linkModules && linkingAllowed(moduleName)) { isIdeaModule = isReactorProject( a.getGroupId(), a.getArtifactId() ); @@ -578,7 +590,8 @@ Element containerElement = createElement( component, "containerElement" ); - if ( linkModules && isReactorProject( artifact.getGroupId(), artifact.getArtifactId() ) ) + if ( linkModules && isReactorProject( artifact.getGroupId(), artifact.getArtifactId() ) + && linkingAllowed(artifact.getArtifactId())) { containerElement.addAttribute( "type", "module" ); containerElement.addAttribute( "name", artifact.getArtifactId() ); @@ -728,7 +741,8 @@ Element containerElement = createElement( component, "containerElement" ); - if ( linkModules && isReactorProject( artifact.getGroupId(), artifact.getArtifactId() ) ) + if ( linkModules && isReactorProject( artifact.getGroupId(), artifact.getArtifactId() ) + && linkingAllowed(artifact.getArtifactId())) { containerElement.addAttribute( "type", "module" ); containerElement.addAttribute( "name", artifact.getArtifactId() ); @@ -764,6 +778,24 @@ element.addAttribute( "relative", "/" ); element.addAttribute( "url", getModuleFileUrl( warSrc ) ); } + + private boolean linkingAllowed(String name) + { + if(linkModulesExcept == null) + return true; + + String[] moduleNames = linkModulesExcept.split(","); + + for (int i = 0; i < moduleNames.length; i++) + { + String moduleName = moduleNames[i]; + if(moduleName.trim().equals(name)) + return false; + } + + return true; + } + /** * Translate the relative path of the file into module path @@ -929,4 +961,4 @@ return deploymentDescriptor; } -} \ No newline at end of file +} Index: src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java =================================================================== --- src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java (revision 452786) +++ src/main/java/org/apache/maven/plugin/idea/IdeaMojo.java (working copy) @@ -56,6 +56,15 @@ * @parameter expression="${linkModules}" default-value="true" */ private boolean linkModules; + + /** + * Whether to exclude certain reactor projects from inclusion as dependency modules. + * + * Default is empty, comma-seperated list of modules which should be excluded (they will be linked as jar-libraries instead). + * + * @parameter expression="${linkModulesExcept}" default-value="" + */ + private String linkModulesExcept; /** * Whether to use full artifact names when referencing libraries. @@ -198,7 +207,7 @@ IdeaModuleMojo mojo = new IdeaModuleMojo(); mojo.initParam( executedProject, artifactFactory, localRepo, artifactResolver, artifactMetadataSource, getLog(), - overwrite, executedProject, reactorProjects, wagonManager, linkModules, useFullNames, + overwrite, executedProject, reactorProjects, wagonManager, linkModules, linkModulesExcept, useFullNames, downloadSources, sourceClassifier, downloadJavadocs, javadocClassifier, libraries, macros, exclude, dependenciesAsLibraries );