I think I know why it didn't work: I was not in the project's directory.
I don't call mvn myself but it's done from a shell script which is done
in a different directory (with the -f option).
Here's your example run:
1- in the project directory... everything works fine
2- outside the project directory... the profile doesn't get activated
macb-003:~/Development/test/parent jl$ 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 /Users/jl/Development/test/parent/pom.xml to
/Users/jl/.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 /Users/jl/Development/test/parent/module1/pom.xml to
/Users/jl/.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 /Users/jl/Development/test/parent/module2/pom.xml to
/Users/jl/.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.734s]
[INFO] Example module1 ....................................... SUCCESS
[0.007s]
[INFO] Example module2 ....................................... SUCCESS
[0.016s]
[INFO]
------------------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Mar 20 17:30:49 EDT 2007
[INFO] Final Memory: 3M/7M
[INFO]
------------------------------------------------------------------------
macb-003:~/Development/test/parent jl$ cd ..
macb-003:~/Development/test jl$ mvn -f parent/pom.xml 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 /Users/jl/Development/test/parent/pom.xml to
/Users/jl/.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 /Users/jl/Development/test/parent/module1/pom.xml to
/Users/jl/.m2/repository/org/example/module1/0.0.1-SNAPSHOT/module1-0.0.1-SNAPSHOT.pom
[INFO]
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
------------------------------------------------------------------------
[INFO] Example parent ........................................ SUCCESS
[1.593s]
[INFO] Example module1 ....................................... SUCCESS
[0.012s]
[INFO]
------------------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Tue Mar 20 17:31:06 EDT 2007
[INFO] Final Memory: 3M/7M
[INFO]
------------------------------------------------------------------------
Jean-Luc
Thierry Lach wrote:
Then you're probably doing something wrong. Here's a simple test case.
(...)
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]