Ad

Showing posts with label Software - Maven. Show all posts
Showing posts with label Software - Maven. Show all posts

Monday, May 9, 2011

Integrating soap ui maven plugin

What a pleasure, a way to integrate your soap ui project into a maven build :)

Just pop this into your pom.xml from where your web module is located; this will start/stop jetty for the soap ui plugin to invoke its tests:


<plugin>
               <groupId>org.mortbay.jetty</groupId>
               <artifactId>maven-jetty-plugin</artifactId>
               <version>6.1.21</version>
               <configuration>
                   <stopKey>foo</stopKey>
                   <stopPort>9999</stopPort>
                   <webAppConfig>
                       <contextPath>/test</contextPath>
                   </webAppConfig>
               </configuration>
               <executions>
                   <execution>
                       <id>start-jetty</id>
                       <phase>pre-integration-test</phase>
                       <goals>
                           <goal>run</goal>
                       </goals>
                       <configuration>
                           <scanIntervalSeconds>0</scanIntervalSeconds>
                           <daemon>true</daemon>
                       </configuration>
                   </execution>
                   <execution>
                       <id>stop-jetty</id>
                       <phase>post-integration-test</phase>
                       <goals>
                           <goal>stop</goal>
                       </goals>
                   </execution>
               </executions>
           </plugin>




And insert the soap ui plugin to invoke on inegration-test phase pointing to a valid soap ui project XML:

<plugin>
                <groupId>eviware</groupId>
                <artifactId>maven-soapui-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <projectFile>${project.basedir}/soapui-project.xml
                    </projectFile>
                    <outputFolder>${project.basedir}/target/test/soapui-results</outputFolder>
                    <junitReport>true</junitReport>
                </configuration>
                <executions>
                    <execution>
                        <id>soapUI</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Tuesday, April 19, 2011

Maven assembly plugin - create jar dependancies directory

Here is how to create a directory within a maven module containing all the dependant jars referenced by the module itself:

Put this in the pom.xml:

<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>distro-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>


And then put this in assembly.xml:

<assembly>
<id>uberjar</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<unpack>false</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>${project.build.outputDirectory}</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
</assembly>

Wednesday, April 6, 2011

Grails Maven Integration

If you want to migrate an existing grails project created with the typical 'create-app' grails tool (that by default uses Ant as build tool) to maven, u can use this command:

mvn org.grails:grails-maven-plugin:1.3.2:create-pom -DgroupId=com.mycompany

http://grails.org/doc/latest/guide/4.%20The%20Command%20Line.html#Mavenizing an existing project