通过 tomcat7-maven-plugin 部署不断添加“/deploy?path”到目标路径
Deployment via tomcat7-maven-plugin keeps adding "/deploy?path" to the target path
我正在尝试使用 ##
符号将我的应用程序的新版本部署到路径 /app-test
。
我已经将 pom.xml
中的 warFileName
设置为 app-test##2021-01-21-pkix-fix
然后调用
mvn clean tomcat7:deploy
成功生成并构建了 .war
:
...
[INFO] Generating war /xyz/target/app-test##2021-01-21-pkix-fix.war
[INFO] Building war: /xyz/target/app-test##2021-01-21-pkix-fix.war
随着它继续上传资源,它会尝试多次上传 同时第二次添加 /deploy?path
。第三次尝试更没有意义:
[INFO] Deploying war to http://mydomain.eu/app-test##2021-01-21-pkix-fix
Uploading: http://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploaded: http://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploading: https://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploaded: https://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploading: https://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploaded: https://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
然后部署失败:
FAIL - Failed to deploy application at context path /app-test##2021-01-21-pkix-fix/deploy?path=/app-test##2021-01-21-pkix-fix
因为 路径不能包含 =
字符 ,catalina-daemon.out
错误日志证实了这一点:
...
javax.management.MalformedObjectNameException: Invalid character '=' in value part of property
at javax.management.ObjectName.construct(ObjectName.java:618)
at javax.management.ObjectName.<init>(ObjectName.java:1382)
...
这是我的浓缩 pom.xml
。
我怀疑这与我最近通过自制软件进行的 mvn
升级有关。这是我当前的版本:
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
Java version: 1.8.0_112, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"
为什么 tomcat 不断将 /deploy?path
添加到我的部署中?
我正在进一步调查,这很可能与 tomcat7-maven-plugin
有关,但 the docs 还没有真正澄清任何事情。
当所有其他方法都失败时,始终可以选择手动部署 .war
。
先打包程序:
mvn clean package [-P profile_name]
然后在/target
中找到.war
:
我正在尝试使用 ##
符号将我的应用程序的新版本部署到路径 /app-test
。
我已经将 pom.xml
中的 warFileName
设置为 app-test##2021-01-21-pkix-fix
然后调用
mvn clean tomcat7:deploy
成功生成并构建了 .war
:
...
[INFO] Generating war /xyz/target/app-test##2021-01-21-pkix-fix.war
[INFO] Building war: /xyz/target/app-test##2021-01-21-pkix-fix.war
随着它继续上传资源,它会尝试多次上传 同时第二次添加 /deploy?path
。第三次尝试更没有意义:
[INFO] Deploying war to http://mydomain.eu/app-test##2021-01-21-pkix-fix
Uploading: http://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploaded: http://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploading: https://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploaded: https://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploading: https://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploaded: https://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
然后部署失败:
FAIL - Failed to deploy application at context path /app-test##2021-01-21-pkix-fix/deploy?path=/app-test##2021-01-21-pkix-fix
因为 路径不能包含 =
字符 ,catalina-daemon.out
错误日志证实了这一点:
...
javax.management.MalformedObjectNameException: Invalid character '=' in value part of property
at javax.management.ObjectName.construct(ObjectName.java:618)
at javax.management.ObjectName.<init>(ObjectName.java:1382)
...
这是我的浓缩 pom.xml
。
我怀疑这与我最近通过自制软件进行的 mvn
升级有关。这是我当前的版本:
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
Java version: 1.8.0_112, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"
为什么 tomcat 不断将 /deploy?path
添加到我的部署中?
我正在进一步调查,这很可能与 tomcat7-maven-plugin
有关,但 the docs 还没有真正澄清任何事情。
当所有其他方法都失败时,始终可以选择手动部署 .war
。
先打包程序:
mvn clean package [-P profile_name]
然后在/target
中找到.war
: