thanks Kaare,

using the profiles did work.

regards,
Andy

> Ok..
> The configuration that was posted is a configuration that would start
> in the package phase by e.g. typing mvn package.
> If you would like to have the plugin configured for use in the
> commandline you do not need to specify the <goals> tag in the plugin
> configuration.
> Then to have 2 different setups for the commandline you could use
> profiles: 
> http://maven.apache.org/guides/introduction/introduction-to-profiles.html.
>
> example :
> <profiles>
>     <profile>
>         <activation>
>             <property>
>                 <name>testServer</name>
>             </property>
>         </activation>
>         <build>
>             <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>exec-maven-plugin</artifactId>
>                 <configuration>
>                     <executable>java</executable>
>                     <arguments>
>                         <argument>-classpath</argument>
>                         <classpath />
>                         <argument>
>                             de.jos.bla.TestServer
>                         </argument>
>                     </arguments>
>                 </configuration>
>             </plugin>
>         </build>
>     </profile>
>     <profile>
>         <activation>
>             <property>
>                 <name>clientServer</name>
>             </property>
>         </activation>
>         <build>
>             <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>exec-maven-plugin</artifactId>
>                 <configuration>
>                     <executable>java</executable>
>                     <arguments>
>                         <argument>-classpath</argument>
>                         <classpath />
>                         <argument>
>                             de.jos.bla.Client (or what ever)
>                         </argument>
>                     </arguments>
>                 </configuration>
>             </plugin>
>         </build>
>     </profile>
> </profiles
>
>
> then in your commandline you could run the client with
> mvn exec:exec -DclientServer
> and the test server with:
> mvn exec:exec -DtestServer
>
> /Kaare
>
> On 12/03/06, Andreas Wüst <[EMAIL PROTECTED]> wrote:
>   
>> Hello Kaare,
>>
>> thanks for your reply. unfortunately it does not work. i am getting the
>> following error.
>> for some reason the plugin seems to expect,  the  configuration tag
>> outside the execution
>> tag, which means that there can only be one configuration tag. any more
>> ideas.
>>
>> by the way. how to i properly start a specific configuration. so far i
>> have been
>> using "mvn exec:exec". how'd i specify the "id" of the configuration to
>> execute.
>>
>> thanks in advance,
>>
>> Andy
>>
>>
>> [INFO]
>> -------------------------------------------------------------------------
>> ---
>> [ERROR] BUILD ERROR
>> [INFO]
>> -------------------------------------------------------------------------
>> ---
>> [INFO] One or more required plugin parameters are invalid/missing for
>> 'exec:exec
>> '
>>
>> [0] inside the definition for plugin: 'exec-maven-plugin'specify the
>> following:
>>
>> <configuration>
>>   ...
>>   <executable>VALUE</executable>
>> </configuration>
>>
>> -OR-
>>
>> on the command line, specify: '-Dexec.executable=VALUE'
>>
>> [INFO]
>> -------------------------------------------------------------------------
>> ---
>> [INFO] For more information, run Maven with the -e switch
>>     
>>> Hi..
>>> you'r almost there ;)
>>> So what you could do is :
>>> <plugin>
>>>     <groupId>org.codehaus.mojo</groupId>
>>>     <artifactId>exec-maven-plugin</artifactId>
>>>     <executions>
>>>         <execution>
>>>             <id>testserver</id>
>>>             <phase>package</phase>
>>>             <goals>
>>>                  <goal>exec</goal>
>>>             </goals>
>>>             <configuration>
>>>                 <executable>java</executable>
>>>                 <arguments>
>>>                     <argument>-classpath</argument>
>>>                     <!-- automatically creates the classpath using all
>>> project dependencies -->
>>>                     <classpath />
>>>                     <argument>
>>>                         de.jos.bla.TestServer
>>>                     </argument>
>>>                 </arguments>
>>>             </configuration>
>>>         </execution>
>>>         <execution>
>>>             <id>client</id>
>>>             <phase>package</phase>
>>>             <goals>
>>>                  <goal>exec</goal>
>>>             </goals>
>>>             <configuration>
>>>                 <executable>java</executable>
>>>                 <arguments>
>>>                     <argument>-classpath</argument>
>>>                     <!-- automatically creates the classpath using all
>>> project dependencies -->
>>>                     <classpath />
>>>                     <argument>
>>>                         de.jos.bla.Client (or what ever the main class is)
>>>                     </argument>
>>>                 </arguments>
>>>             </configuration>
>>>         </execution>
>>>     </executions>
>>> </plugin>
>>>
>>>
>>> Best regards
>>> /Kaare
>>>
>>>
>>> On 12/03/06, Andreas Wüst <[EMAIL PROTECTED]> wrote:
>>>
>>>       
>>>> Hello all,
>>>>
>>>> i have a project that has two main classes (testserver / client).
>>>> however, i have no idea how to
>>>> configure and start the second main. one is easy (testserver). but how
>>>> do i have to configure the second
>>>> main class, so i can start the client from the command line. my pom so
>>>> far looks like :
>>>>
>>>>     <plugin>
>>>>                 <groupId>org.codehaus.mojo</groupId>
>>>>                 <artifactId>exec-maven-plugin</artifactId>
>>>>                 <executions>
>>>>                     <execution>
>>>>                         <id>testserver</id>
>>>>                         <phase>package</phase>
>>>>                         <goals>
>>>>                             <goal>exec</goal>
>>>>                         </goals>
>>>>                     </execution>
>>>>                 </executions>
>>>>                 <configuration>
>>>>                     <executable>java</executable>
>>>>                     <arguments>
>>>>                         <argument>-classpath</argument>
>>>>                         <!-- automatically creates the classpath using
>>>> all project dependencies -->
>>>>                         <classpath />
>>>>                         <argument>
>>>>                             de.jos.bla.TestServer
>>>>                         </argument>
>>>>                     </arguments>
>>>>                 </configuration>
>>>>             </plugin>
>>>>
>>>>
>>>> thanks in advance,
>>>> Andy
>>>>
>>>>
>>>>         
>>>
>>>
>>>       
>>     
>
>
>
>   

Reply via email to