2

I use maven bundle plugin for bundle spring project. I'm use spring property placeholder in my project. When I building my project I take following warnings:

[WARNING] Bundle groupId:artifactId:bundle:1.9-SNAPSHOT : No translation found for macro: spring.property

How I can prevent this warnings message ? May be some maven bundle plugin settings can help me ?

Thanks

1 Answers1

3

It appears that the maven-bundle-plugin (v. 2.5.3 at the time of writing) has its own go at resource filtering after the resource plugin is done. If the resource plugin cannot replace a property it will simply leave it as it is. Which is what you want, of course, if the property is in a Spring context file to be replaced by Spring at run-time. But the left-over properties confuse the bundle plugin.

The only way around this that I could find was to disable resource filtering for the Spring context file. In the build section of your POM add something along the lines of this:

<resources>
    <!-- globally enable resource filtering -->
    <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
    </resource>
    <!-- then disable it for specific resources -->
    <resource>
        <directory>src/main/resources</directory>
        <includes>
            <include>**/*-context.xml</include>
        </includes>
        <filtering>false</filtering>
    </resource>
</resources>

You can also turn it around and explicitly include your to be filtered files in a resource declaration that enables filtering and globally disable filtering.

Ralf
  • 6,735
  • 3
  • 16
  • 32