Skip to content

Instantly share code, notes, and snippets.

View eugenp's full-sized avatar

Eugen eugenp

View GitHub Profile
@eugenp
eugenp / maven-surefire-plugin-main.xml
Created October 16, 2011 14:24
How to run integration tests with the Maven cargo plugin - maven-surefire-plugin main configuration
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
</excludes>
</configuration>
</plugin>
@eugenp
eugenp / maven-surefire-plugin-profile.xml
Created October 16, 2011 16:38
How to run integration tests with the Maven cargo plugin - maven-surefire-plugin integration profile configuration
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
@eugenp
eugenp / maven-newProfile.xml
Created October 16, 2011 14:37
How to run integration tests with the Maven cargo plugin - the new profile
<profiles>
<profile>
<id>integration</id>
<build>
<plugins>
...
</plugins>
</build>
@eugenp
eugenp / cargo-maven2-plugin.xml
Created October 16, 2011 16:35
How to run integration tests with the Maven cargo plugin - cargo-maven2-plugin configuration
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<wait>false</wait>
</configuration>
<executions>
<execution>
<id>start-server</id>
<phase>pre-integration-test</phase>
@eugenp
eugenp / cargo-maven2-plugin_base.xml
Created October 16, 2011 17:37
How to run integration tests with the Maven cargo plugin - cargo-maven2-plugin base configuration
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.1.3</version>
<configuration>
<wait>true</wait>
<container>
<containerId>jetty7x</containerId>
<type>embedded</type>
</container>
@eugenp
eugenp / pom.xml
Created October 18, 2011 19:19
Bootstraping a web application with Spring 3.1 and Java based Configuration, part 2 - the pom.xml
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org</groupId>
<artifactId>rest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
@eugenp
eugenp / AppConfig.java
Created October 19, 2011 20:50
Bootstraping a web application with Spring 3.1 and Java based Configuration, part 1 - the AppConfig
@Configuration
@ImportResource( { "classpath*:/rest_config.xml" } )
@ComponentScan( basePackages = "org.rest" )
public class AppConfig{
@Bean
public static PropertyPlaceholderConfigurer properties(){
PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
final Resource[] resources = new ClassPathResource[ ] {
new ClassPathResource( "persistence.properties" ),
@eugenp
eugenp / web.xml
Created October 19, 2011 20:52
Bootstraping a web application with Spring 3.1 and Java based Configuration, part 1 - the web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>rest</display-name>
<context-param>
@eugenp
eugenp / pom_part1.xml
Created October 19, 2011 21:36
Bootstraping a web application with Spring 3.1 and Java based Configuration, part 1 - the pom.xml
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org</groupId>
<artifactId>rest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
@eugenp
eugenp / milestone_repo.xml
Created October 20, 2011 20:17
Bootstraping a web application with Spring 3.1 and Java based Configuration, part 1 - the milestone spring repository
<repository>
<id>org.springframework.maven.milestone</id>
<name>Maven Central Compatible Spring Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>