5

Windows サービスとして Tomcat 7 を実行しています。そして、プロジェクトのルート ディレクトリに mvn:tomcat deploy を実行したいと考えています。

しかし、常にこのエラーが表示されます。

[INFO] Deploying war to http://localhost:8080/opendata
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.493s
[INFO] Finished at: Sun Jan 20 18:48:30 CET 2013
[INFO] Final Memory: 15M/39M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy
(default-cli) on project opendata: Cannot invoke Tomcat manager: Server returned
 HTTP response code: 405 for URL: http://localhost:8080/manager/deploy?path=%2Fo
pendata&war= -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception

pom ファイルに次のセクションがあります。

<build>
        <finalName>opendata</finalName>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <configuration>
                    <server>myserver</server>
                </configuration>
                <version>1.1</version>
            </plugin>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
4

2 に答える 2

1

今日、同様の問題に遭遇しました.405エラーは、TomcatがPUTリクエストを受け入れないことが原因である可能性があります. これは、Tomcat の web.xml (通常は にあります%TOMCAT%\conf\web.xml) を構成し、次の init-param を追加することで許可できます。

<init-param>
    <param-name>readonly</param-name>
    <param-value>false</param-value>
</init-param>

また、管理者ユーザーを tomcat-users.xml に追加する必要がある場合もあります。詳しくはこちらをご覧ください。

于 2013-10-31T13:05:42.007 に答える