Build Helper Maven Plugin – Usage

您所在的位置:网站首页 usapge Build Helper Maven Plugin – Usage

Build Helper Maven Plugin – Usage

#Build Helper Maven Plugin – Usage| 来源: 网络整理| 查看: 265

Set a property according to whether target files are up to date with respect to their sources

'Up to date' means that the target file both exists and has a 'last modification timestamp' (java.io.File.lastModified()) equal to or later than that of the corresponding source file(s).

Source files are computed relative to the fileset's required directory property. If the fileset has an outputDirectory property, target files are computed relative to that; otherwise, target files are also computed relative to directory.

The fileset element supports a mapper, whose type can be any of the built-in mappers flatten glob identity merge package unpackage. Alternatively, the classname property can specify the fully qualified name of a class that implements org.apache.maven.shared.model.fileset.mappers.FileNameMapper.

The uptodate-property goal can be used to set a property to a value if specified target files are up to date. For example, executing the following plugin configuration to set the obj.status property.

... org.codehaus.mojo build-helper-maven-plugin 3.4.0 obj-uptodate uptodate-property obj.status fresh stale src/main/c target/obj mod-*/** **/*.old.* glob *.c *.o ...

After the goal executes (by default during the validate phase) the obj.status property would have the value fresh if all target/obj/**/*.o object files were up to date with respect to their corresponding src/main/c/mod-*/**/*.c source files (excluding any with .old. in the name); otherwise, the property would have the value stale.

To set multiple properties for multiple file sets in one execution, use the uptodate-properties goal. The upToDatePropertySetting element supports all the configuration properties documented above for the uptodate-property goal.

... org.codehaus.mojo build-helper-maven-plugin 3.4.0 lib-doc-uptodate uptodate-properties lib.uptodate target/obj target/lib merge *.o mylibrary.so doc.uptodate src/main/c target/site/doc merge *.c mylibrary.html ...

After the goal executes, the lib.uptodate property would have the value true if target/lib/mylibrary.so is up to date with respect to all the target/obj/**/*.o object files. Also, the doc.uptodate property would have the value true if target/site/doc/mylibrary.html is up to date with respect to src/main/c/**/*.c.



【本文地址】


今日新闻


推荐新闻


    CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3