Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

Commit

Permalink
Ensure tonr samples work from command line
Browse files Browse the repository at this point in the history
Tomcat plugin configuration needs to be extracted so that
it applies to all runs (not just integration tests)

Fixes gh-164
  • Loading branch information
dsyer committed Mar 24, 2014
1 parent 22b4be8 commit 47f7552
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 35 deletions.
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -31,11 +31,15 @@ have installed the artifacts locally (as per the getting started
instructions above) you should be able to

$ cd samples/oauth2/tonr
$ mvn tomcat:run
$ mvn tomcat7:run

and visit the app in your browser at [http://localhost:8080/tonr2/](http://localhost:8080/tonr2/)
to check that it works. (This is for the OAuth 2.0 sample, for the
OAuth 1.0a sample just remove the "2" from the directory path.)
OAuth 1.0a sample just remove the "2" from the directory path.) Integration tests
require slightly different settings for Tomcat so you need to add a profile:

$ cd samples/oauth2/tonr
$ mvn integration-test -P integration

## Changelog

Expand Down
2 changes: 1 addition & 1 deletion samples/README.md
Expand Up @@ -19,7 +19,7 @@ to read his photos for the purpose of printing them.

To run the apps the easiest thing is to first install all the
artifacts using `mvn install` and then go to the `tonr` directory (in
`oauth` or `oauth2`) and run `mvn tomcat:run`. You can also use the
`oauth` or `oauth2`) and run `mvn tomcat7:run`. You can also use the
command line to build war files with `mvn package` and drop them in
your favourite server, or you can run them directly from an IDE.

Expand Down
12 changes: 7 additions & 5 deletions samples/oauth/sparklr/pom.xml
@@ -1,4 +1,5 @@
<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/maven-v4_0_0.xsd">
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -32,8 +33,8 @@
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<path>/sparklr</path>
<addContextWarDependencies>true</addContextWarDependencies>
Expand Down Expand Up @@ -101,7 +102,8 @@
</dependency>
</dependencies>

<!-- <profiles> <profile> <id>gae</id> <dependencies> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.2.2</version> </dependency> </dependencies> </profile> </profiles> -->
<!-- <profiles> <profile> <id>gae</id> <dependencies> <dependency> <groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId> <version>1.2.2</version> </dependency>
</dependencies> </profile> </profiles> -->

</project>
18 changes: 14 additions & 4 deletions samples/oauth/tonr/pom.xml
@@ -1,4 +1,5 @@
<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/maven-v4_0_0.xsd">
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -27,11 +28,20 @@
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<path>/tonr</path>
<addContextWarDependencies>true</addContextWarDependencies>
<webapps>
<webapp>
<contextPath>/sparklr2</contextPath>
<groupId>${pom.groupId}</groupId>
<artifactId>sparklr</artifactId>
<version>${pom.version}</version>
<type>war</type>
<asWebapp>true</asWebapp>
</webapp>
</webapps>
</configuration>
</plugin>
</plugins>
Expand Down
15 changes: 8 additions & 7 deletions samples/oauth2/sparklr/pom.xml
@@ -1,4 +1,5 @@
<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/maven-v4_0_0.xsd">
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -41,17 +42,17 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<executions>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<executions>
<execution>
<id>start-tomcat</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<path>/sparklr2</path>
<path>/sparklr2</path>
<fork>true</fork>
</configuration>
</execution>
Expand All @@ -76,8 +77,8 @@
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<addContextWarDependencies>true</addContextWarDependencies>
</configuration>
Expand Down
28 changes: 14 additions & 14 deletions samples/oauth2/tonr/pom.xml
@@ -1,4 +1,5 @@
<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/maven-v4_0_0.xsd">
<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/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -52,17 +53,6 @@
</goals>
<configuration>
<fork>true</fork>
<addContextWarDependencies>true</addContextWarDependencies>
<webapps>
<webapp>
<contextPath>/sparklr2</contextPath>
<groupId>${pom.groupId}</groupId>
<artifactId>sparklr2</artifactId>
<version>${pom.version}</version>
<type>war</type>
<asWebapp>true</asWebapp>
</webapp>
</webapps>
</configuration>
</execution>
</executions>
Expand All @@ -86,10 +76,20 @@
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<addContextWarDependencies>true</addContextWarDependencies>
<webapps>
<webapp>
<contextPath>/sparklr2</contextPath>
<groupId>${pom.groupId}</groupId>
<artifactId>sparklr2</artifactId>
<version>${pom.version}</version>
<type>war</type>
<asWebapp>true</asWebapp>
</webapp>
</webapps>
</configuration>
</plugin>
<plugin>
Expand Down
2 changes: 0 additions & 2 deletions samples/oauth2/tonr/src/main/webapp/oauth_error.jsp
@@ -1,5 +1,3 @@
<%@ page import="java.io.PrintWriter"%>
<%@ page import="java.io.StringWriter"%>
<%@ taglib prefix="authz"
uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
Expand Down

0 comments on commit 47f7552

Please sign in to comment.