简体   繁体   English

Maven 基于文件更改构建

[英]Maven builds on file changes

Is there anything already out there that would help with either / both of following?是否已经有任何东西可以帮助以下任一/两个?

  • Perform a Maven install when a file within that module changes当该模块中的文件更改时执行 Maven 安装
  • Perform a Maven install on the module and its dependencies if they have changed如果模块及其依赖项已更改,在模块及其依赖项上执行 Maven 安装

I'm pretty sure I've heard of a Maven option to build dependencies as well but struggling to find anything from Googling...我很确定我也听说过 Maven 选项来构建依赖项,但是很难从谷歌搜索中找到任何东西......

Perhaps this isn't going to be Maven specific but instead involve a file watching tool that is OS specific, if so I would be interested in hearing about tools for Windows (XP).也许这不是特定于 Maven 的,而是涉及特定于操作系统的文件监视工具,如果是这样,我将有兴趣了解适用于 Windows (XP) 的工具。

Even though the answer comes late, I was looking for the same thing and I found https://github.com/rzymek/watcher-maven-plugin .即使答案来晚了,我也在寻找同样的东西,我找到了https://github.com/rzymek/watcher-maven-plugin Maybe someone else will be looking for the same thing.也许其他人会寻找同样的东西。

I tried @Adrian's solution, but I couldn't get it working.我尝试了@Adrian 的解决方案,但无法正常工作。

I found this maven package, https://github.com/fizzed/maven-plugins#watcher-fizzed-watcher-maven-plugin , that will watch for file changes, and I was able to get it working pretty quickly.我找到了这个 maven 包https://github.com/fizzed/maven-plugins#watcher-fizzed-watcher-maven-plugin ,它将监视文件更改,并且我能够很快让它工作。

To building a module and its dependencies, use: mvn -pl :module -amd要构建模块及其依赖项,请使用: mvn -pl :module -amd

Automated builds are usually triggered from a version system like subversion or git.自动构建通常由版本系统(如 subversion 或 git)触发。 Then you can use continuous integration tools like Jenkins.然后你就可以使用像 Jenkins 这样的持续集成工具。

There's also mvn reactor:make-scm-changes, which detects what modules have local changes vs. the configured scm system.还有 mvn reactor:make-scm-changes,它检测哪些模块有本地更改,而不是配置的 scm 系统。

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

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