简体   繁体   English

Maven-最佳实践生产类路径/瓶子组织? (非战争/耳朵)

[英]Maven - Best Practice Production Classpath/Jar Organisation? (Non-WAR/EAR)

Simple console maven artifacts with shared dependencies (some also provide public API's in addition to their own class) living on same production server. 驻留在同一生产服务器上的具有共享依赖项的简单控制台Maven工件(有些还提供了自己的类,另外还提供了公共API)。 How to best organise/install on production server? 如何最好地组织/安装在生产服务器上?

My instinct is for a single folder holding all (version numbered) jars (ie. a 'flattened'/dependency populated 'repository') however: 我的直觉是要保存所有(版本编号)罐子的单个文件夹(例如,“扁平化” /依赖项填充的“存储库”):

(a) Can't see how such a folder would increase, on a 'dependency' basis, it's population from maven deployment repository (a)无法看到这样的文件夹在“依赖”的基础上如何增加来自maven部署存储库的填充量

(b) How a jar's manifest's classpath would change from the default 'lib/...,lib/...' (ie. relative to 'main' jar, sensible for dev/test using Eclipse) to just '...,...' (b)jar的清单清单的类路径如何从默认的'lib / ...,lib / ...'(即相对于'main'jar,相对于使用Eclipse进行开发/测试而言)变为'... ,...'

What is recommended best practice as regards organisation on production server? 关于在生产服务器上进行组织的推荐最佳实践是什么?

Google'ing 'maven production classpath' (amongst others) resulted in http://blog.armstrongconsulting.com/?p=232 which seems related but light on detail. Google的“ maven生产类路径”(以及其他)导致了http://blog.armstrongconsulting.com/?p=232 ,这似乎很相关,但细节很浅。

Any pointers? 有指针吗?

How experienced are you with Maven? 您对Maven的经验如何? If you are the process described in the blog you mention is pretty straightforward also without going into details. 如果您是博客中描述的过程,那么您提到的内容也非常简单,无需赘述。

Re (a): Dependencies are downloaded from a remote Maven repository into a local Maven repository on demand. 关于(a):依赖项根据需要从远程Maven存储库下载到本地Maven存储库。 Default in ${user.home}/.m2/repository or according to <localRepository> at the beginning of your settings.xml . 默认在${user.home}/.m2/repository <localRepository> ${user.home}/.m2/repository或者根据<localRepository>开头的<localRepository> settings.xml See Introduction to Repositories . 请参阅存储库简介 So, there's no need for a single 'flattened'/dependency populated 'repository' folder. 因此,不需要单个“拼合” /相关性填充的“存储库”文件夹。

A local repository can also be populated with the install:install-file goal manually. 也可以使用install:install-file目标手动填充本地存储库。 But this can be a cumbersome process if there are many artifacts to install. 但是,如果要安装的工件很多,这可能是一个麻烦的过程。

See Maven, Available Plugins for what the mentioned plugin:goals do. 有关所提到的插件:目标的信息请参见Maven,可用插件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM