I believe that it is not possible to change JAXB classes without a re-build. But, here I am wondering whether the structure of the WSDL (not taking about data values) is changing from environment to environment? If it is all together a different WSDL, obviously you need a fresh build.
In the above scenario, you may use Maven Profile feature.
If it is the same WSDL (only data values changes as per environment), then it is your code logic should be generic enough to work with different possible data values. If it is so, a single build should be working in all the environment.
EDIT - As per Op comments
Yes I am using maven profile for environment based build. And, the
wsdl structure is going to be same across the environments so code
break is not a problem. I was just wondering if there is way to this
scenario.
As per the comments, I feel that it is not a build related area, but related to deployment of an artifact with below assumption:
- Once tested in test environment, the build would work perfectly in other environment.
- The build would be able to pick right internal config based on a parameter provided externally. e.g. If Java app build is having a
env-dev.config and env-prod.config files, then based on a JVM flag -Denv=prod; it should pick right config file at runtime.
With this assumptions, you do not need a maven profile. Now coming to deployment, you may use some kind of webstore. e.g. a maven repository. The deployment script should pick the artifacts from the webstore and deploy it.
The process flow may be summarized as:
- Use a CI (continuous integration) tool like
Jenkin to make a test build.
- In the CI tool, make a provision to upload the artifacts to
webstore as part of post-build step. E.g. You may upload to your local maven repository server.
- As part of deployment, the deployment script would
get the artifacts from webstore and deploy on the test environment.
- Deploy the artifact on test environment through above mechanism. Perform the testing.
- If a bug is found during testing, fix the bug and re-build/deploy through CI tool.
- Again use CI tool for
stage/prod deployment. Please note that you need to simply skip build process. This would be a deployment-only process.
- The deployment process should always pick latest (or a configurable version). So, version control is an important aspect.