我正在 Tomcat 上运行 Maven 存储库管理器 Nexus。当我设置 pom 文件时,我的存储库 URL 看起来都类似于 http://myhost/nexus/repo-name
。我想从网址中删除“nexus”一词。我们目前正在从较旧的存储库管理器过渡,现在我们需要更新所有 URL。但是,如果我们有一个通用存储库 URL,例如 http://myhost/maven-repo/repo-name,那么该 URL 将独立于存储库管理器。
我怎样才能在Tomcat上设置这样的东西?我需要设置主机名别名吗?或者有更简单的方法来做到这一点吗?
谢谢,
杰夫
I'm running the maven repository manager Nexus on Tomcat. When I setup my pom file, my repository URLs all look something like http://myhost/nexus/repo-name
. I'd like to get the word "nexus" out of the URL. We're currently transitioning from an older repository manager and now we need to update all of the URLs. However, if we had a generic repository URL like http://myhost/maven-repo/repo-name
, then the URL would be independent of the repository manager.
How can I set something like this up on Tomcat? Would I need to setup host name aliases? Or is there an easier way to do this?
Thanks,
Jeff
发布评论
评论(3)
我会使用前端 Apache 服务器(仅 httpd,而不是 Tomcat)来执行此操作,配置为反向代理。
Apache url 重写和反向代理很容易配置。有了这个 Apache 前端代理,您就可以独立于 Nexus,也可以独立于 Tomcat 服务器。
使用相同的 Apache URL,您可以移动到 Archiva .java.net/" rel="nofollow noreferrer">Glassfish 服务器(例如)对项目透明。
I would use a frontal Apache server (only httpd, not Tomcat) to do that, configured as a reverse proxy.
Apache url rewriting and reverse proxy are easy to configure. With this Apache frontal proxy, you are independant from Nexus, but also from the Tomcat server.
With the same Apache URL, you can move to Archiva on a Glassfish server (for example) transparently for the projects.
将应用程序部署到 Tomcat 的根文件夹中。
Deploy your application in the root folder of Tomcat.
我希望你不要将存储库位置放入您的 pom 中?您应该改用settings.xml 文件。
I hope you don't put repository locations into your pom's? You should use settings.xml file instead.