title: OAuth2 spring example sparklr and tonr
body: <p>I'm trying to get the example of tonr and sparklr working for the framework spring.  I am running into errors with maven.  This is where I'm getting the source code from <a href="https://github.com/spring-projects/spring-security-oauth" rel="nofollow">https://github.com/spring-projects/spring-security-oauth</a> and this is the tutorial I am following: <a href="https://github.com/spring-projects/spring-security-oauth/wiki/tutorial" rel="nofollow">https://github.com/spring-projects/spring-security-oauth/wiki/tutorial</a>.  Note: I have successfully made oauth work, but not oauth2.  </p>
  
  <p>Here is the first error I get when I run  </p>
  
  <pre><code>mvn tomcat:run
  </code></pre>
  
  <p>for sparklr.</p>
  
  <pre><code>1 required artifact is missing.
  
  for artifact: 
    org.springframework.security.oauth:sparklr2:war:2.0.0.BUILD-SNAPSHOT
  
  from the specified remote repositories:
    central (http://repo1.maven.org/maven2),
    java.net (http://download.java.net/maven/2),
    spring-release (http://maven.springframework.org/release),
    spring-milestone (http://maven.springframework.org/milestone)
  </code></pre>
  
  <p>This is the error I get for tonr</p>
  
  <pre><code>2 required artifacts are missing.
  
  for artifact: 
    org.springframework.security.oauth:tonr2:war:2.0.0.BUILD-SNAPSHOT
  
  from the specified remote repositories:
    central (http://repo1.maven.org/maven2),
    spring-release (http://maven.springframework.org/release),
    spring-milestone (http://maven.springframework.org/milestone)
  </code></pre>
  
  <p>Here are the pom.xml file for sparklr</p>
  
  <pre><code>&lt;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"&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.security.oauth&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-oauth-parent&lt;/artifactId&gt;
          &lt;version&gt;2.0.0.BUILD-SNAPSHOT&lt;/version&gt;
          &lt;relativePath&gt;../../..&lt;/relativePath&gt;
      &lt;/parent&gt;
  
      &lt;artifactId&gt;sparklr2&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;name&gt;OAuth for Spring Security - Sparklr2 (OAuth 2 Provider Example)&lt;/name&gt;
  
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;integration&lt;/id&gt;
              &lt;build&gt;
                  &lt;plugins&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                          &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                          &lt;version&gt;2.7.1&lt;/version&gt;
                          &lt;executions&gt;
                              &lt;execution&gt;
                                  &lt;id&gt;surefire-it&lt;/id&gt;
                                  &lt;phase&gt;integration-test&lt;/phase&gt;
                                  &lt;goals&gt;
                                      &lt;goal&gt;test&lt;/goal&gt;
                                  &lt;/goals&gt;
                                  &lt;configuration&gt;
                                      &lt;skip&gt;${skipTests}&lt;/skip&gt;
                                      &lt;testFailureIgnore&gt;false&lt;/testFailureIgnore&gt;
                                  &lt;/configuration&gt;
                              &lt;/execution&gt;
                          &lt;/executions&gt;
                      &lt;/plugin&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                          &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt;
                          &lt;version&gt;1.1&lt;/version&gt;
                          &lt;executions&gt;
                              &lt;execution&gt;
                                  &lt;id&gt;start-tomcat&lt;/id&gt;
                                  &lt;phase&gt;pre-integration-test&lt;/phase&gt;
                                  &lt;goals&gt;
                                      &lt;goal&gt;run&lt;/goal&gt;
                                  &lt;/goals&gt;
                                  &lt;configuration&gt;
                                      &lt;fork&gt;true&lt;/fork&gt;
                                  &lt;/configuration&gt;
                              &lt;/execution&gt;
                          &lt;/executions&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
              &lt;/build&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;!--skip deploy (this is just a test module) --&gt;
                  &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.6&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;skip&gt;true&lt;/skip&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
          &lt;pluginManagement&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                      &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt;
                      &lt;configuration&gt;
                          &lt;addContextWarDependencies&gt;true&lt;/addContextWarDependencies&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/pluginManagement&gt;
      &lt;/build&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-milestone&lt;/id&gt;
              &lt;name&gt;Spring Framework Milestone Repository&lt;/name&gt;
              &lt;url&gt;http://maven.springframework.org/milestone&lt;/url&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-release&lt;/id&gt;
              &lt;name&gt;Spring Framework Release Repository&lt;/name&gt;
              &lt;url&gt;http://maven.springframework.org/release&lt;/url&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;java.net&lt;/id&gt;
              &lt;url&gt;http://download.java.net/maven/2&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-oauth2&lt;/artifactId&gt;
              &lt;version&gt;${project.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-taglibs&lt;/artifactId&gt;
              &lt;version&gt;${spring.security.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
              &lt;version&gt;1.8.3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;cglib&lt;/groupId&gt;
              &lt;artifactId&gt;cglib&lt;/artifactId&gt;
              &lt;version&gt;2.2.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
              &lt;!-- Needed for testing (with Spring 4 only), but not at runtime --&gt;
              &lt;version&gt;3.0.1&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.8.2&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
              &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
              &lt;version&gt;4.3.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>Here is the pom.xml file for tonr</p>
  
  <pre><code>&lt;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"&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.security.oauth&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-oauth-parent&lt;/artifactId&gt;
          &lt;version&gt;2.0.0.BUILD-SNAPSHOT&lt;/version&gt;
          &lt;relativePath&gt;../../..&lt;/relativePath&gt;
      &lt;/parent&gt;
  
      &lt;artifactId&gt;tonr2&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;name&gt;OAuth for Spring Security - Tonr2 (OAuth 2 Client Example)&lt;/name&gt;
  
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;integration&lt;/id&gt;
              &lt;build&gt;
                  &lt;plugins&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                          &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                          &lt;version&gt;2.7.1&lt;/version&gt;
                          &lt;executions&gt;
                              &lt;execution&gt;
                                  &lt;id&gt;surefire-it&lt;/id&gt;
                                  &lt;phase&gt;integration-test&lt;/phase&gt;
                                  &lt;goals&gt;
                                      &lt;goal&gt;test&lt;/goal&gt;
                                  &lt;/goals&gt;
                                  &lt;configuration&gt;
                                      &lt;skip&gt;${skipTests}&lt;/skip&gt;
                                      &lt;testFailureIgnore&gt;false&lt;/testFailureIgnore&gt;
                                  &lt;/configuration&gt;
                              &lt;/execution&gt;
                          &lt;/executions&gt;
                      &lt;/plugin&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                          &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt;
                          &lt;version&gt;1.1&lt;/version&gt;
                          &lt;executions&gt;
                              &lt;execution&gt;
                                  &lt;id&gt;start-tomcat&lt;/id&gt;
                                  &lt;phase&gt;pre-integration-test&lt;/phase&gt;
                                  &lt;goals&gt;
                                      &lt;goal&gt;run&lt;/goal&gt;
                                  &lt;/goals&gt;
                                  &lt;configuration&gt;
                                      &lt;fork&gt;true&lt;/fork&gt;
                                  &lt;/configuration&gt;
                              &lt;/execution&gt;
                          &lt;/executions&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
              &lt;/build&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;!--skip deploy (this is just a test module) --&gt;
                  &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.6&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;skip&gt;true&lt;/skip&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
          &lt;pluginManagement&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                      &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt;
                      &lt;configuration&gt;
                          &lt;addContextWarDependencies&gt;true&lt;/addContextWarDependencies&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/pluginManagement&gt;
      &lt;/build&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-milestone&lt;/id&gt;
              &lt;name&gt;Spring Framework Milestone Repository&lt;/name&gt;
              &lt;url&gt;http://maven.springframework.org/milestone&lt;/url&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-release&lt;/id&gt;
              &lt;name&gt;Spring Framework Release Repository&lt;/name&gt;
              &lt;url&gt;http://maven.springframework.org/release&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
      &lt;dependencies&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;${pom.groupId}&lt;/groupId&gt;
              &lt;artifactId&gt;sparklr2&lt;/artifactId&gt;
              &lt;version&gt;${pom.version}&lt;/version&gt;
              &lt;type&gt;war&lt;/type&gt;
              &lt;scope&gt;tomcat&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-oauth2&lt;/artifactId&gt;
              &lt;version&gt;${project.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-taglibs&lt;/artifactId&gt;
              &lt;version&gt;${spring.security.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-aop&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-expression&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
              &lt;version&gt;1.5.5&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
              &lt;version&gt;3.0.1&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.8.2&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
  &lt;/project&gt;
  </code></pre>