0

我的 BW 6.x 应用程序有不同的基于环境的配置文件属性文件。项目是 mavenized,我需要在 POM.xml 中引用属性文件,我将如何实现这一点。

4

1 回答 1

0

尝试使用以下代码MyAppModule/POM.xml

<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>MyAppModule</artifactId>
    <packaging>bwmodule</packaging>
    <name>MyAppModule</name>
    <description>MyAppModule</description>

    <parent>
        <groupId>com.exemple.tibco</groupId>
        <artifactId>MyAppModule.application.parent</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <relativePath>../MyAppModule.application.parent</relativePath>
    </parent>

    <build>
        <sourceDirectory>src</sourceDirectory>
        <outputDirectory>target/classes</outputDirectory>
        <plugins>
            <plugin>
                <groupId>com.tibco.plugins</groupId>
                <artifactId>bw6-maven-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>
</project>

并在all.parent/POM.xml

<?xml version='1.0' encoding='UTF-8'?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://maven.apache.org/POM/4.0.0"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.exemple.tibco</groupId>
    <artifactId>all.parent</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <properties>
        <project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
        <skipTests>true</skipTests>
    </properties>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>com.tibco.plugins</groupId>
                <artifactId>com.tibco.bw.palette.shared</artifactId>
                <version>6.2.500.001</version>
            </dependency>
            <dependency>
                <groupId>com.tibco.plugins</groupId>
                <artifactId>com.tibco.bw.runtime</artifactId>
                <version>6.3.500.002</version>
            </dependency>           
            <dependency>
                <groupId>com.tibco.plugins</groupId>
                <artifactId>org.genxdm.api</artifactId> 
                <version>1.3.2</version>    
            </dependency>   


        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.tibco.plugins</groupId>
                    <artifactId>bw6-maven-plugin</artifactId>
                    <version>2.1.1</version>
                    <extensions>true</extensions>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement> 
    </build>

</project>
于 2019-06-07T10:57:57.697 回答