14

Apache Tomcatバイナリ配布ZIPをmavenアーティファクトとしてホストする公開されているmavenリポジトリはありますか(つまり、 http://tomcat.apache.orgからダウンロードできるファイル(例: http: //mirror.serversupportforum.de/apache )) /tomcat/tomcat-7/v7.0.28/bin/apache-tomcat-7.0.28.zip)?

現在、これらの配布zipを手動でダウンロードして、Nexusリポジトリに配置していますが、POMに追加できるようなリポジトリがあれば、よりエレガントになります。他の誰かがMavenビルド内にTomcatディストリビューションZIPを必要としていますか?この問題にどのように対処しますか?

4

3 に答える 3

39

org.apache.tomcat:tomcatTomcat 7.0.35以降のディストリビューションは、タイプzipまたは。の下のMavenCentralにありtar.gzます。

于 2013-08-30T07:28:42.960 に答える
4

いいえ、そのようなリポジトリやアーティファクトはありません。

事前に構成して製品と一緒に出荷する標準のTomcatがあるため、これについては少し前に調べていました。

最終的に、公式サイトから(Maven経由で)Tomcat zipをダウンロードし、必要な変更を適用して、Nexusにプッシュしました。

これが多かれ少なかれ私たちがそれを行う方法です:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat</artifactId>
    <version>7.0.28-ourbranding-1-SNAPSHOT</version>
    <packaging>pom</packaging>

    <name>Pre-Configured Tomcat</name>

    <properties>
        <version.tomcat>7.0.28</version.tomcat>
        <tomcat.archive.file>${project.build.directory}/apache-tomcat-${version.tomcat}.zip</tomcat.archive.file>
    </properties>

    <build>    
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.3</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.6</version>

                <executions>
                    <execution>
                        <id>repackage-tomcat</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>

                        <configuration>
                            <target>
                                <echo message="Re-packaging ${tomcat.archive.file}..." />

                                <unzip src="${basedir}/src/main/lib/apache-tomcat-${version.tomcat}.zip" dest="${project.build.directory}" />

                                <move file="${project.build.directory}/apache-tomcat-${version.tomcat}" tofile="${project.build.directory}/tomcat" />

                                <!-- Remove the default webapps -->
                                <delete dir="${project.build.directory}/tomcat/webapps/docs" />
                                <delete dir="${project.build.directory}/tomcat/webapps/manager" />
                                <delete dir="${project.build.directory}/tomcat/webapps/host-manager" />
                                <delete dir="${project.build.directory}/tomcat/webapps/examples" />

                                <!-- Patch the bin/catalina* scripts to include some of our jars in the classpath -->

                                <!-- ... Some more magic goes on here ... -->
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${tomcat.archive.file}</file>
                                    <type>zip</type>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

</project>
于 2012-06-27T09:21:36.713 に答える
2

私が確かに知っている唯一の場所は次のとおりです。

http://archive.apache.org/dist/tomcat/

Mavenダウンロードで使用できます...

于 2012-06-27T09:32:34.160 に答える