maven如何只编译修改的java文件? [英] How does maven compile only the modified java files?

查看:870
本文介绍了maven如何只编译修改的java文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道这个,当我给mvn安装而不做'干净',maven只编译修改的java文件。 maven如何识别一个java文件是否被修改?我相信它没有使用文件的最后修改的属性。

I was just curious to know this, when i give mvn install without doing 'clean', maven compiles only the modified java files. How does maven identify a java file is modified or not? I believe it is not using the last modified property of the file.

我相信的原因:我有一个模块,合并来自svn的更改后,我给了mvn install,它没有编译修改的文件,当我看更改我看到'长'被修改为'长'在getters和setters。

Reason for my belief: I had a module, after merging a change from svn, i gave mvn install and it didn't compile the modified file and when i looked at the change i saw that 'long' were modified to 'Long' in getters and setters.

所以我只想知道maven如何识别如果一个java文件已更改或不是?

So i just want to know how maven identifies if a java file has changed or not?

(PS我使用的是Apache Maven 3.0.3,如果这很重要)

(P.S I'm using Apache Maven 3.0.3, if that matters)

推荐答案

我相信Maven编译器插件使用源文件和类文件上的最后修改日期来确定是否需要重新编译。

I believe the Maven compiler plugin uses last modified dates on the source and class files to determine whether recompilation is necessary.

href =http://maven.apache.org/plugins/maven-compiler-plugin/>网站是相当短的信息,但编译器:compile 目标网页包含有关以下属性的信息,这些属性可精细调整过期计算: http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#staleMillis 。这是关于陈腐的唯一官方声明。

The compiler website is rather short on information, but the compiler:compile goal page has information on the following attribute, which finely tunes the staleness calculations: http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#staleMillis. That's about the only official statement regarding staleness.

这篇关于maven如何只编译修改的java文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆