I have couple of maven projects:

mainProject(WAR)

 - messages.properties
 - messages_pt.properties
 - messages_ja.properties

projectForTesting(JAR)

Any of the above knows nothing about the other one.

My goal is to provide internationalization with ResourceBundleMessageSource for projectForTesting based on messages.properties from mainProject.

I've tried to play with:

maven-war-plugin

but, I am not sure whether it will be correct one.

It will be good to know how can I correctly add dependency for projectForTesting that all properties from mainProject will be accessible.

有帮助吗?

解决方案

I've already fixed this stuff in the following way:

I've added to pom.xml of mainProject

<plugin>
    <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
            <packagingIncludes>**/*.properties,**/*.class</packagingIncludes>
        <attachClasses>true</attachClasses>
        </configuration>
 </plugin>

Then add dependency for projectForTesting:

    <dependency>
        <groupId>com.project.test</groupId>
        <artifactId>mainProject</artifactId>
        <version>${project.version}</version>
        <classifier>classes</classifier>
    </dependency>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top