I am using a plugin to generate soap service client code. My wsdl files are located at src/main/resources/wsdl/dev and src/main/resources/wsdl/prod folders. I have 2 profiles: application-dev.properties and appllication-prod.properties
I would like to change the <wsdlFile> tag value based on the active profile. I specified the parts with ${app.env} below that need to change dynamically. Is there any way to do that?
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.6</version>
<configuration>
<wsdlDirectory>${project.basedir}/src/main/resources/wsdl/${app.env}</wsdlDirectory>
<packageName>com.example.jwt.jwtdemo.dto.cmsapi</packageName>
<wsdlFiles>
<wsdlFile>${project.basedir}/src/main/resources/${app.env}/wsdl/MyLoginService_1.wsdl</wsdlFile>
<wsdlFile>${project.basedir}/src/main/resources/${app.env}/wsdl/MyService_1.wsdl</wsdlFile>
</wsdlFiles>
<sourceDestDir>
${project.basedir}/src/main/java
</sourceDestDir>
</configuration>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
</plugin>
You have two profile-specific properties files.
Each one can define
app.envcorrectly, which means the the<wsdlFile>tag value will change based on the active profile.But you could also use OS environment variables.
Both options, however, are for when the app is starting, not dynamically during runtime.