-
1. Re: Maven resource filtering doesn't work in a SwitchYard project
rcernich May 23, 2013 10:42 PM (in response to tadayosi)1 of 1 people found this helpfulHey Tadayoshi,
Unforutunately, the SwitchYard configure mojo manipulates the switchyard.xml file directly, which as you've discovered does not apply any filtering.
You may be able to workaround the issue by configuring the configure mojo to create its output switchyard.xml file in a different folder that can then be picked up by the resources mojo copying it into the target folder, applying any filtering. The "orders" demo in SwitchYard quickstarts uses this approach to redirect the output into the appropriate war output directory and should give some guidance on how you might proceed.
That said, I'm guessing there's an enhancement request in here that would allow the SwitchYard configure mojo to apply filtering.
Hope that helps.
Best,
Rob
-
2. Re: Maven resource filtering doesn't work in a SwitchYard project
mageshbk May 23, 2013 10:47 PM (in response to tadayosi)Hi Tadayoshi,
Maven filtering works, but our Mojo picks up the unfiltered resource when generating the config. You can overcome this by generating the filtered resource to another directory and then including that in the Mojo configuration.
<plugin> <artifactId>maven-resources-plugin</artifactId> <executions> <execution> <id>copy-resources</id> <phase>validate</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${basedir}/target/extra-resources</outputDirectory> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> </configuration> </execution> </executions> </plugin> ... <plugin> <groupId>org.switchyard</groupId> <artifactId>switchyard-plugin</artifactId> <configuration> <scannerClassNames> <param>org.switchyard.component.bean.config.model.BeanSwitchYardScanner</param> <param>org.switchyard.transform.config.model.TransformSwitchYardScanner</param> </scannerClassNames> <scanDirectories> <param>${basedir}/target/extra-resources</param> </scanDirectories> </configuration> ...
You can also pass in system property in surefire plugin and the property will be substituted at runtime.
-
3. Re: Maven resource filtering doesn't work in a SwitchYard project
mageshbk May 23, 2013 10:48 PM (in response to rcernich)Hi Rob,
I just misssed your post
cheers,
Magesh
-
4. Re: Maven resource filtering doesn't work in a SwitchYard project
tadayosi May 24, 2013 1:32 AM (in response to mageshbk)Hi Rob and Magesh,
Thank you for the answers! They both are accurate and insightful, and solved the problem. FYI, this simple addition to the Mojo configuration below is enough for my project.
<plugin> <groupId>org.switchyard</groupId> <artifactId>switchyard-plugin</artifactId> <configuration> ... <scanDirectories> <param>${project.build.outputDirectory}</param> </scanDirectories> </configuration> ... </plugin>
While I already have a workaround, for posterity I'll create a feature request to the SY Mojo so that we won't need such an additional configuration. Thanks again.
Best regards,
Tadayoshi