gradle rootspec filesMatching using pattern



我正在尝试在战争中操纵一些文件,如下所示

war{
    rootSpec.filesMatching('**/WEB-INF/spring/root-context*.xml'){ detail ->
            // change the name of detail file
        }
}

由于某种原因,模式匹配不起作用。只有完全匹配的工作原理如下

 war{
        rootSpec.filesMatching('**/WEB-INF/spring/root-context.xml'){ detail ->
                // change the name of detail file
            }
    }

在这个文件夹中有不同的文件,以"root-context"开头,我只想在战争中包含一个文件。

我在文件匹配调用中做错了什么吗?

仅在下面检查工作。

相应地改变了我的逻辑。

war{
    rootSpec.filesMatching('**/WEB-INF/spring/*.xml'){ detail ->
            // change the name of detail file
        }
}

最新更新