我试图从运行样品http://projects.spring.io/spring-security/
本指南介绍了如何从春天工具套件(STS)运行insecuremvc示例: http://docs.spring.io/spring-security/site/docs/3.2.x/guides/hellomvc.html
我怎样才能运行在命令行中(而不是从STS)的样本?
我试着加入以下的pom.xml - >项目/建设/插件:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/</path>
<uriEncoding>UTF-8</uriEncoding>
<hostName>localhost</hostName>
<port>8080</port>
<update>true</update>
<useTestClasspath>true</useTestClasspath>
</configuration>
</plugin>
运行
$ mvn package tomcat7:run
but browsing http://localhost:8080/sample/
I get a HTTP Status 400 - The request sent by the client was syntactically incorrect.
基于卢克的回答解决方案
$ git clone https://github.com/spring-projects/spring-security.git
$ cd spring-security/samples/insecuremvc
$ ../../gradlew tasks
# this shows several defined tasks, tomcatRunWar among them
$ ../../gradlew tomcatRunWar