Pregunta

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.

¿Fue útil?

Solución

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>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top