Java maven tomcat7部署错误403
你好 我知道这类问题已经在这里提出过好几次了,我读了很多答案,不幸的是,到目前为止,我还是没有任何效果 我在用什么:Java maven tomcat7部署错误403,java,maven,tomcat,plugins,deployment,Java,Maven,Tomcat,Plugins,Deployment,你好 我知道这类问题已经在这里提出过好几次了,我读了很多答案,不幸的是,到目前为止,我还是没有任何效果 我在用什么: <server> <id>TomcatServer</id> <username>testuser</username> <password>testpw</password> </server> ... <modelVersion>4.0.0</mod
<server>
<id>TomcatServer</id>
<username>testuser</username>
<password>testpw</password>
</server>
...
<modelVersion>4.0.0</modelVersion>
<groupId>com.mr</groupId>
<artifactId>myWebapp</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>my Web App</name>
<url>http://maven.apache.org</url>
<dependencies>
...
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://LuklHost:port/manager</url>
<server>TomcatServer</server>
<username>testuser</username>
<password>passwd</password>
<path>/myWebapp</path>
</configuration>
</plugin>
</plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>TomcatServer</server>
<username>testuser</username>
<password>passwd</password>
<path>/myWebApp</path>
</configuration>
</plugin>
- 窗口7
- 雄猫7
- Maven-插件“tomcat7 Maven插件”
- 应用程序后端有java,前端有javascript
<server>
<id>TomcatServer</id>
<username>testuser</username>
<password>testpw</password>
</server>
...
<modelVersion>4.0.0</modelVersion>
<groupId>com.mr</groupId>
<artifactId>myWebapp</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>my Web App</name>
<url>http://maven.apache.org</url>
<dependencies>
...
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://LuklHost:port/manager</url>
<server>TomcatServer</server>
<username>testuser</username>
<password>passwd</password>
<path>/myWebapp</path>
</configuration>
</plugin>
</plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>TomcatServer</server>
<username>testuser</username>
<password>passwd</password>
<path>/myWebApp</path>
</configuration>
</plugin>
使用Maven构建并自动部署应用程序。
通过tomcat插件,我计划自动部署生成的war文件。我希望这个想法不是已经错了;如果有,请告诉我
好的,让我列出我在不同文件中设置的内容和执行的内容
maven的Settings.xml:
<server>
<id>TomcatServer</id>
<username>testuser</username>
<password>testpw</password>
</server>
...
<modelVersion>4.0.0</modelVersion>
<groupId>com.mr</groupId>
<artifactId>myWebapp</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>my Web App</name>
<url>http://maven.apache.org</url>
<dependencies>
...
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://LuklHost:port/manager</url>
<server>TomcatServer</server>
<username>testuser</username>
<password>passwd</password>
<path>/myWebapp</path>
</configuration>
</plugin>
</plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>TomcatServer</server>
<username>testuser</username>
<password>passwd</password>
<path>/myWebApp</path>
</configuration>
</plugin>
问题:
<server>
<id>TomcatServer</id>
<username>testuser</username>
<password>testpw</password>
</server>
...
<modelVersion>4.0.0</modelVersion>
<groupId>com.mr</groupId>
<artifactId>myWebapp</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>my Web App</name>
<url>http://maven.apache.org</url>
<dependencies>
...
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://LuklHost:port/manager</url>
<server>TomcatServer</server>
<username>testuser</username>
<password>passwd</password>
<path>/myWebapp</path>
</configuration>
</plugin>
</plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>TomcatServer</server>
<username>testuser</username>
<password>passwd</password>
<path>/myWebApp</path>
</configuration>
</plugin>
为什么会出现这个错误?当然,我怎样才能修复它呢
实际上,我真的不能准确地说,因为我想我检查了所有的东西,甚至是哪个文件夹有哪些权限
希望有想法和帮助
提前感谢,,
梅鲁我想把这个解决方案添加为“答案”,因为我搜索了很长时间,也许其他人不需要花那么多时间。正如我已经写过的,注释“text”需要附加到pom.xml中插件的插件部分的url中。 让我分享一下我现在得到的: maven>conf>settings.xml
<server>
<id>TomcatServer</id>
<username>testuser</username>
<password>testpw</password>
</server>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="admin-gui"/>
<user username="testuser" password="passwd" roles="admin-gui, manager-gui,manager-script"/>
TomcatServer
测试用户
testpw
tomcat>conf>tomcat用户.xml
<server>
<id>TomcatServer</id>
<username>testuser</username>
<password>testpw</password>
</server>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="admin-gui"/>
<user username="testuser" password="passwd" roles="admin-gui, manager-gui,manager-script"/>
但我认为最重要的是更改URL,这也是我问题的答案
pom.xml:
<server>
<id>TomcatServer</id>
<username>testuser</username>
<password>testpw</password>
</server>
...
<modelVersion>4.0.0</modelVersion>
<groupId>com.mr</groupId>
<artifactId>myWebapp</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>my Web App</name>
<url>http://maven.apache.org</url>
<dependencies>
...
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://LuklHost:port/manager</url>
<server>TomcatServer</server>
<username>testuser</username>
<password>passwd</password>
<path>/myWebapp</path>
</configuration>
</plugin>
</plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>TomcatServer</server>
<username>testuser</username>
<password>passwd</password>
<path>/myWebApp</path>
</configuration>
</plugin>
org.apache.tomcat.maven
tomcat7 maven插件
2
http://localhost:8080/manager/text
TomcatServer
测试用户
passwd
/myWebApp
powershell中的命令
<server>
<id>TomcatServer</id>
<username>testuser</username>
<password>testpw</password>
</server>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="admin-gui"/>
<user username="testuser" password="passwd" roles="admin-gui, manager-gui,manager-script"/>
mvn tomcat7:部署
经过很长一段时间,我让它工作了,我想与大家分享解决方案,这对我来说很有效。localhost:8080/manager/text请注意末尾的“text”。此外,我在tomcat-users.xml中只设置了manager脚本、manager gui和admin gui作为角色。但我认为“文本”是缺失的。