Skip to content

Commit

Permalink
Add "integration" profile in Maven build
Browse files Browse the repository at this point in the history
By default it is on, but you can switch it
off (`-P '!integration'`) to ignore integration tests
and get a faster build.

.travis.yml uses this feature so that it doesn't keep
failing on a timeout.
  • Loading branch information
Dave Syer committed Nov 6, 2013
1 parent dac470a commit 8cb0211
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 63 deletions.
17 changes: 2 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
language: java
services: mongodb

install: mvn install -U -DskipTests=true -Pspring-snapshot
before_script:
- "gem install travis-artifacts"
- "mvn -version"
script: mvn install -nsu -Dmaven.test.redirectTestOutputToFile=true

after_failure:
- "for f in `find . -name build.log`; do travis-artifacts upload --path $f; done"

env:
global:
- "ARTIFACTS_AWS_REGION=us-east-1"
- "ARTIFACTS_S3_BUCKET=temp.springsource.com/spring-boot"
- secure: "JCQ1uz/rfrtMiUAvxeMznVB2wTX/f7lrCBa6oOsskDPt1dMzxD4aEuOfq3QlROLPDhYyu3dnWh1+ABla3Dx4+dCVA9ASgFCq5ivO5Vkxr4c6g8tb7hp14EitGEnWfEpdn64K6mZ7e7a/yjaXU3Ry4AisvPSk7wCcbHisBbj1LzE="
- secure: "Dcya9JSXSa9qXDBXUihYxfCBL8VKCoIj5SQARMshYGLrs1zN2C4EcO4lcMkePTHWrGjpSqNdgnChUeg9YphWqODCcy2XhaMlSxwBYBDTye3hLGwKNdMKnrl/4yE+GoBg6Zaj9bB46Ua/GwLgZpOgM/b/VuCqnp6JC+hYOZKBhdg="
install: mvn install -U -DskipTests=true -P spring-snapshot
script: mvn install -nsu -P '!integration'
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
<module>spring-boot-actuator</module>
<module>spring-boot-starters</module>
<module>spring-boot-cli</module>
</modules>
</profile>
<profile>
<id>integration</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<modules>
<module>spring-boot-integration-tests</module>
</modules>
</profile>
Expand Down
19 changes: 17 additions & 2 deletions spring-boot-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,19 @@
<properties>
<main.basedir>${basedir}/..</main.basedir>
<start-class>org.springframework.boot.cli.SpringCli</start-class>
<spring.profiles.active>default</spring.profiles.active>
</properties>
<profiles>
<profile>
<id>integration</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<spring.profiles.active>integration</spring.profiles.active>
</properties>
</profile>
</profiles>
<dependencyManagement>
<dependencies>
<dependency>
Expand Down Expand Up @@ -152,9 +164,12 @@
<additionalClasspathElements>
<additionalClasspathElement>${project.build.directory}/generated-resources</additionalClasspathElement>
</additionalClasspathElements>
<systemPropertyVariables>
<spring.profiles.active>${spring.profiles.active}</spring.profiles.active>
</systemPropertyVariables>
</configuration>
</plugin>
<!-- Build an executable JAR manually since we can't easily depend on
<!-- Build an executable JAR manually since we can't easily depend on
a maven plugin that is part of the reactor -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -263,7 +278,7 @@
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
Expand Down
58 changes: 33 additions & 25 deletions spring-boot-tools/spring-boot-loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,39 @@
<properties>
<main.basedir>${basedir}/../..</main.basedir>
</properties>
<profiles>
<profile>
<id>integration</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<settingsFile>src/it/settings.xml</settingsFile>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<postBuildHookScript>verify</postBuildHookScript>
<addTestClassPath>true</addTestClassPath>
<skipInvocation>${skipTests}</skipInvocation>
<streamLogs>true</streamLogs>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -24,29 +57,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<settingsFile>src/it/settings.xml</settingsFile>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<postBuildHookScript>verify</postBuildHookScript>
<addTestClassPath>true</addTestClassPath>
<skipInvocation>${skipTests}</skipInvocation>
<streamLogs>true</streamLogs>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
54 changes: 33 additions & 21 deletions spring-boot-tools/spring-boot-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,39 @@
<properties>
<main.basedir>${basedir}/../..</main.basedir>
</properties>
<profiles>
<profile>
<id>integration</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<settingsFile>src/it/settings.xml</settingsFile>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<postBuildHookScript>verify</postBuildHookScript>
<addTestClassPath>true</addTestClassPath>
<skipInvocation>${skipTests}</skipInvocation>
<streamLogs>true</streamLogs>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<!-- Compile -->
<dependency>
Expand Down Expand Up @@ -102,27 +135,6 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<settingsFile>src/it/settings.xml</settingsFile>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<postBuildHookScript>verify</postBuildHookScript>
<addTestClassPath>true</addTestClassPath>
<skipInvocation>${skipTests}</skipInvocation>
<streamLogs>true</streamLogs>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 8cb0211

Please sign in to comment.