【发布时间】:2017-06-27 16:16:42
【问题描述】:
这里是我的 pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>modules</artifactId>
<groupId>com.agipi</groupId>
<version>${global.version}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>com.agipi.layouts</artifactId>
<packaging>war</packaging>
<properties>
<project.test>1.2.3</project.test>
</properties>
<build>
<resources>
<resource>
<directory>src/main/webapp/WEB-INF</directory>
<filtering>true</filtering>
</resource>
</resources>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>com.liferay.maven.plugins</groupId>
<artifactId>liferay-maven-plugin</artifactId>
<version>7.0.0-m2</version>
<configuration>
<pluginType>layouttpl</pluginType>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
还有我在 src/main/webapp/WEB-INF 中的文件“liferay-plugin-package.properties”之一:
Bundle-Version=${project.test}
当我执行 mvn clean install 时,该值不会被替换。有什么想法吗?
编辑:实际上在 target/ 中,我得到了一个 .war,其中的值没有被替换,我也得到了一些文件夹。
其中一个是“类”文件夹,我在其中获得了文件“liferay-plugin-package.properties”,其中的值被替换。
我需要在 .war 中替换值
【问题讨论】:
-
您要归档什么样的文件?请显示整个 pom 文件和项目的结构...
-
我已经编辑了我的帖子
-
在这种情况下,我建议使用 Apache Felix 项目或 bndTools 中的 maven-bundle-plugin 之类的东西...。这比通过过滤等处理更容易。此外,我不明白为什么一场战争需要一个包含捆绑版本的 MANIFEST.MF?仅对于将用作依赖项的捆绑包,这是必需的...
-
我试过了,但没有任何反应,战争中的 MANIFEST.MF 不包含 Bundle-Version 密钥
标签: maven