Maven Assembly:设置外部 svn 以供程序内使用

发布于 2024-12-14 00:08:04 字数 713 浏览 1 评论 0原文

我有一个非常具体的问题。我正在进行的项目是一个maven3驱动的多模块项目。该项目使用 SVN-Api 同步存储库中的数据并对其进行处理。更具体地说: 管理器在收到更新调用后,将联系远程 svn 存储库并将文件同步到硬盘驱动器,然后在硬盘驱动器上处理它们。

我想使用程序集插件创建适当的文件夹结构。当我运行 package 命令时,理想情况下目标文件夹中的输出将是

target
- data <- this is the base folder for the external repository
--- .svn <-- repository-information
--- group1 <-- subfolders on repository
--- group2
--- group3
- program.jar <-- contains java classes, executable
- config.xml  <--- config file, editable by user
- other miscalleanous files

坦率地说,这会带来很多问题,除此之外,我对程序集插件没有太多经验。我不太明白的是我如何区分应该放入 jar 中的文件和应该保存在 jar 之外的文件。

我已经阅读了有关程序集描述符的信息,但是我只看到了包含或排除文件的示例,没有提供有关文件稍后在目标文件夹中的相对位置的信息。

感谢您抽出时间。 问候, 基诺

I have a very specific question. The project I am on is a maven3 driven multi-module Project. The Project uses the SVN-Api to synchronize data from a repository and process it. More specifically:
A Manager, upon recieving an update call, will contact a remote svn repository and sync the files to the harddrive, where it will afterwards process them.

I want to create an appropriate folder Structure, with the assembly plugin. When I run a package command, ideally the output in the target folder would be

target
- data <- this is the base folder for the external repository
--- .svn <-- repository-information
--- group1 <-- subfolders on repository
--- group2
--- group3
- program.jar <-- contains java classes, executable
- config.xml  <--- config file, editable by user
- other miscalleanous files

So frankly, this poses a number of problems and on top of this, I don't have too much experience with the assembly plugin. What I am not quite getting is how I am able to differentiate between files that should be put into the jar and files that should be kept outside the jar.

I have read about the assembly descriptors, I have however only seen examples that either include or exclude files, none that provide information about the relative positions the files should later have in the target folder.

Thanks for your time.
Regards,
Keno

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

感悟人生的甜 2024-12-21 00:08:04

因此,经过一番研究后,我决定采用以下(简单)方式:

启动时,程序获取其 jar 文件所在的位置,然后检查 char 外部的资源文件夹。如果没有找到,它会检查 svn 服务器的基本目录并开始处理数字。这种方式不需要对 Maven pom 进行任何修改,并且它也适用于测试。

So after some research I decided to go the following (simple) way:

At startup, The program fetches the location it's jar file is at, then checks for an resource folder outside the char. If none is found, it checks out the base directory of the svn server and starts crunching numbers. This way didn't require any fiddeling with the maven pom, and it works for testing as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文