Maven 本地主机的Tomcat领域安全约束禁用
我添加了安全约束以保护应用程序的一些文件夹Maven 本地主机的Tomcat领域安全约束禁用,maven,tomcat,plugins,realm,security-constraint,Maven,Tomcat,Plugins,Realm,Security Constraint,我添加了安全约束以保护应用程序的一些文件夹 <security-constraint> <web-resource-collection> <web-resource-name>panel</web-resource-name> <url-pattern>/secured/*</url-pattern> </web-resource-collection>
<security-constraint>
<web-resource-collection>
<web-resource-name>panel</web-resource-name>
<url-pattern>/secured/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>super</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Panel</realm-name>
</login-config>
面板
/安全的/*
超级的
基本的
面板
我向tomcat用户添加了适当的超级用户,当我部署应用程序时,这一切似乎都运行良好。但是,当我使用tomcat7:run从exclipse通过maven在本地运行它时,我的本地设置没有tomcat-users.xml文件,因此基本上我不确定如何在本地配置用户。安全工作,但没有定义用户
你能告诉我如何为mavens tomcat插件传递或指定自定义tomcat-sers.xml文件吗?如果有人需要的话,我已经得到了它 在pom.xml中找到tomcat7 maven插件的插件块,并在配置中指定自定义tomcat-users.xml路径
<configuration>
<tomcatUsers>path/tomcat-users.xml</tomcatUsers>
</configuration>
path/tomcat-users.xml