java - Maven 没有像我预期的那样替换
问题描述
我在 pom.xml 中定义了一些配置文件,以便使资源映射依赖于操作系统。它第一次工作(一周前),但现在在 git clone 之后,它停止了工作。
这是我的 pom.xml 个人资料:
<profile>
<id>windows</id>
<activation>
<os>
<family>dos</family>
</os>
</activation>
<properties>
<file.mapping>file:///C:/software/photos/</file.mapping>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</profile>
这是我遇到麻烦的地方:
<mvc:resources mapping="/photos/*" location="@file.mapping@"></mvc:resources>
这是“原始”行,我没有问题。它工作正常:
<mvc:resources mapping="/photos/*" location="file:///C:/software/photos/"></mvc:resources>
它似乎做了一个替换,maven install 和所有这些都没有问题。但是第一行不起作用。我知道这里发生了什么。在 Linux 中工作正常。
解决方案
推荐阅读
- android - Facebook 和 LinkedIn 集成在 beta 版本中不起作用
- android - android:ellipsize="marquee" 不工作
- r - 将XML提取到R中的数据框
- laravel - Laravel:带有分页参数的 API 响应
- java - Java - 存储在内存中的成员变量的引用在哪里?
- node.js - 未找到模块:错误:将 nodejs 版本更新为 10.0 后无法解析“firebase”
- java - 如何添加到 BorderLayout.Center?
- api - 使用 API 时在关闭收集器时删除 SurveyMonkey 品牌?
- reactjs - ReactJS Route 不同的布局
- javascript - 如何根据gridview中文件夹中的特定文件名在gridview中显示文件