In case anybody interested, a sample pom.xml that worked:

start server using mvn -Pserver and client -Pclient

<?xml version="1.0"?>
<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.apache.cxf.samples</groupId>
    <artifactId>wsdl_first</artifactId>
    <version>1.0</version>
    <properties>
        <cxf.version>[2,)</cxf.version>
    </properties>
    <build>
        <sourceDirectory>src</sourceDirectory>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>LATEST</version>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <wsdlOptions>
                                <wsdlOption>
                                   
<wsdl>${basedir}/wsdl/hello_world.wsdl</wsdl>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>   
    <profiles>
        <profile>
            <id>server</id>
            <build>
                <defaultGoal>test</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                   
<mainClass>demo.hw.server.Server</mainClass>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>client</id>
            <build>
                <defaultGoal>test</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                   
<mainClass>demo.hw.client.Client</mainClass>
                                    <arguments>
                                       
<argument>${basedir}/wsdl/hello_world.wsdl</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>snapshots</id>
            <repositories>
                <repository>
                    <id>apache-snapshots</id>
                    <name>Apache SNAPSHOT Repository</name>
                   
<url>http://people.apache.org/repo/m2-snapshot-repository/</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                    <!-- for jaxb-impl -->
                <repository>
                    <id>java.net</id>
                    <url>http://download.java.net/maven/1/</url>
                    <layout>legacy</layout>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>apache-plugin-snapshots</id>
                    <name>Apache Maven Plugin Snapshots</name>
                   
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
    <repositories>
        <!-- for jaxb-impl -->
        <repository>
            <id>java.net</id>
            <url>http://download.java.net/maven/1/</url>
            <layout>legacy</layout>
        </repository>
    </repositories>
    
    <dependencies>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <!-- Jetty is needed if you're using the CXFServlet -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-jetty</artifactId>
            <version>${cxf.version}</version>
        </dependency>
    </dependencies>
</project>


Haim Ashkenazi-2 wrote:
> 
> On Tue, Jul 15, 2008 at 7:14 PM, seanoc <[EMAIL PROTECTED]> wrote:
>>
>> I'm using maven 2.0.9
>>
>> using the pom attached I run the command, mvn exec:exec -Dserver
> I'm not sure this tells maven which execution to run. I think you have
> to either connect the executions to a phase or to a profile and then
> activate the profile as needed.
> You can also discard the "execution" directive and then run it with
> 'mvn exec:exec', but then it'll run only one of them :)
> 
> 
>>
>> The following error occurs:
>>
>>
>> [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'
>>
>> the  http://www.nabble.com/file/p18469173/pom.xml pom.xml snippet is:
>>
>> <plugin>
>>                 <groupId>org.codehaus.mojo</groupId>
>>                 <artifactId>exec-maven-plugin</artifactId>
>>                 <executions>
>>                 <execution>
>>                 <id>server</id>
>>                 <configuration>
>>                 <executable>java</executable>
>>                 <arguments>
>>                 <argument>-classpath</argument>
>>                 <classpath/>
>>                 <argument>demo.hw.server.Server</argument>
>>                 </arguments>
>>                 </configuration>
>>                 <goals>
>>                 <goal>exec</goal>
>>                 </goals>
>>                 </execution>
>>                 <execution>
>>                 <id>client</id>
>>                 <configuration>
>>                 <executable>java</executable>
>>                 <arguments>
>>                 <argument>-classpath</argument>
>>                 <classpath/>
>>                 <argument>demo.hw.client.Client</argument>
>>                 <argument>./wsdl/hello_world.wsdl</argument>
>>                 </arguments>
>>                 </configuration>
>>                 <goals>
>>                 <goal>exec</goal>
>>                 </goals>
>>                 </execution>
>>                 </executions>
>>              </plugin>
>>
> 
> Bye
> -- 
> Haim
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-using-maven-exec-plugin-exec%3Aexec-command-tp18469173p18566455.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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

Reply via email to