Then you're probably doing something wrong.  Here's a simple test case.

parent pom...

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>
 <modelVersion>4.0.0</modelVersion>
 <groupId>org.example</groupId>
 <artifactId>example-parent</artifactId>
 <packaging>pom</packaging>
 <name>Example parent</name>
 <version>0.0.1-SNAPSHOT</version>
 <modules>
   <module>module1</module>
 </modules>
 <profiles>
   <profile>
     <id>module2-build</id>
     <activation>
       <file>
         <exists>module2/pom.xml</exists>
       </file>
     </activation>
     <modules>
       <module>module2</module>
     </modules>
   </profile>
 </profiles>
</project>

module1 pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
 <parent>
   <artifactId>example-parent</artifactId>
   <groupId>org.example</groupId>
   <version>0.0.1-SNAPSHOT</version>
 </parent>
 <modelVersion>4.0.0</modelVersion>
 <groupId>org.example</groupId>
 <artifactId>module1</artifactId>
 <packaging>pom</packaging>
 <version>0.0.1-SNAPSHOT</version>
 <name>Example module1</name>
</project>


module2 pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
 <parent>
   <artifactId>example-parent</artifactId>
   <groupId>org.example</groupId>
   <version>0.0.1-SNAPSHOT</version>
 </parent>
 <modelVersion>4.0.0</modelVersion>
 <groupId>org.example</groupId>
 <artifactId>module2</artifactId>
 <packaging>pom</packaging>
 <version>0.0.1-SNAPSHOT</version>
 <name>Example module2</name>
</project>


execution

C:\src\modules>mvn install
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   Example parent
[INFO]   Example module1
[INFO]   Example module2
[INFO]
----------------------------------------------------------------------------
[INFO] Building Example parent
[INFO]    task-segment: [install]
[INFO]
----------------------------------------------------------------------------
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing C:\src\modules\pom.xml to c:\Documents and
Settings\lacht\.m2\repository\org\example\example-parent\0.0.1-SNAPSHOT
\example-parent-0.0.1-SNAPSHOT.pom
[INFO]
----------------------------------------------------------------------------
[INFO] Building Example module1
[INFO]    task-segment: [install]
[INFO]
----------------------------------------------------------------------------
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing C:\src\modules\module1\pom.xml to c:\Documents and
Settings\lacht\.m2\repository\org\example\module1\0.0.1-SNAPSHOT\module1-
0.0.1-SNAPSHOT.pom
[INFO]
----------------------------------------------------------------------------
[INFO] Building Example module2
[INFO]    task-segment: [install]
[INFO]
----------------------------------------------------------------------------
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing C:\src\modules\module2\pom.xml to c:\Documents and
Settings\lacht\.m2\repository\org\example\module2\0.0.1-SNAPSHOT\module2-
0.0.1-SNAPSHOT.pom
[INFO]
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
------------------------------------------------------------------------
[INFO] Example parent ........................................ SUCCESS [
1.765s]
[INFO] Example module1 ....................................... SUCCESS [
0.015s]
[INFO] Example module2 ....................................... SUCCESS [
0.016s]
[INFO]
------------------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Mar 20 14:16:11 EDT 2007
[INFO] Final Memory: 3M/7M
[INFO]
------------------------------------------------------------------------

C:\src\modules>

and with module2 missing

C:\src\modules>rename module2 module3

C:\src\modules>mvn install
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   Example parent
[INFO]   Example module1
[INFO]
----------------------------------------------------------------------------
[INFO] Building Example parent
[INFO]    task-segment: [install]
[INFO]
----------------------------------------------------------------------------
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing C:\src\modules\pom.xml to c:\Documents and
Settings\lacht\.m2\repository\org\example\example-parent\0.0.1-SNAPSHOT
\example-parent-0.0.1-SNAPSHOT.pom
[INFO]
----------------------------------------------------------------------------
[INFO] Building Example module1
[INFO]    task-segment: [install]
[INFO]
----------------------------------------------------------------------------
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing C:\src\modules\module1\pom.xml to c:\Documents and
Settings\lacht\.m2\repository\org\example\module1\0.0.1-SNAPSHO
T\module1-0.0.1-SNAPSHOT.pom
[INFO]
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
------------------------------------------------------------------------
[INFO] Example parent ........................................ SUCCESS [
1.750s]
[INFO] Example module1 ....................................... SUCCESS [
0.016s]
[INFO]
------------------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Mar 20 14:18:22 EDT 2007
[INFO] Final Memory: 3M/7M
[INFO]
------------------------------------------------------------------------

C:\src\modules>



On 3/20/07, Jean-Luc Wasmer <[EMAIL PROTECTED]> wrote:

That doesn't seem to work: the module never gets built (even when I
don't have an activation section).

Jean-Luc


Thierry Lach wrote:
> I think this will work.... Define each module in a profile, then
> activate it
> if the pom exists, something like this:
>
> <profile>
>  <id>module1-build</id>
>  <activation>
>    <file>
>      <exists>module1/pom.xml</exists>
>    </file>
>  </activation>
>  <modules>
>    <module>module1</modules>
>  </modules>
> </profile>
>
>
>
> On 3/20/07, Jean-Luc Wasmer <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> I would like to disable some modules if their folder is missing instead
>> of failing.
>> How can I do this?
>>
>>
>> Jean-Luc

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to