小编Naz*_*zar的帖子

Maven配置文件属性不是"重写"

我有Maven多模块项目,具有这样的结构:

家长聚甲醛项目

- module1

- module2

在parent-pom-project中我有这样的pom.xml

    <modules>
        <module>module1</module>
    </modules>
...
    <profiles>
        <profile>
           <id>local</id>
           <properties>
               <prop>local_prop</prop>
           </properties>
        </profile>
        <profile>
           <id>test</id>
           <modules>
                <module>module2</module>
           </modules>
           <properties>
               <prop>test_prop</prop>
           </properties>
        </profile>
    </profiles>
Run Code Online (Sandbox Code Playgroud)

在所有pom.xml文件中我都有这样的标记:

<build>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
        <resource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>
</build>
Run Code Online (Sandbox Code Playgroud)

资源目录中的module1和module2,我有包含这样文本的属性文件:

prop=${prop}
Run Code Online (Sandbox Code Playgroud)

问题是之后

mvn clean install

要么

mvn clean install -Ptest

甚至

mvn clean install -P test

我明白了

丙= local_prop

如果我还构建了构建模块2的用户测试配置文件,但是从本地配置文件中使用了属性.我使用Maven 3.0.3.有人有什么想法吗?

java maven-3 maven

13
推荐指数
3
解决办法
2万
查看次数

如何为使用Spring Cache缓存的Spring Web Service设置正确的Last-Modified标头值?

我有这样的Spring MVC控制器:

@Controller
@RequestMapping(value = "/user")
public class UserController {
   .....      
   @Cacheable(value = "users", key = "#id")
   @RequestMapping(value = "/get", method = RequestMethod.GET)
   @ResponseBody
   public User getUser(Long id){
       return userService.get(id);
   }
   ....
}
Run Code Online (Sandbox Code Playgroud)

我想将标题Last-Modified添加到GetUser Web服务的HTTP响应中.
如何在我的商店中添加缓存时获得正确的日期?
如何将此日期的Last-Modified标题添加到Spring Controller方法的响应中?

java spring caching spring-mvc spring-cache

3
推荐指数
2
解决办法
7633
查看次数

标签 统计

java ×2

caching ×1

maven ×1

maven-3 ×1

spring ×1

spring-cache ×1

spring-mvc ×1