I created a eclipse web project by importing a war file. Originally, there was no source code in the war file. I want to build a new war file from this project by changing dynamically the content of one properties file according to diffrent profiles, so that the built war file could be deployed in different environment (development et production).
But since there is no source code in the original war file, thus no source code in the project, after converting this project to maven project, and setting the packaging to war in the pom.xml, maven shows the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war >(default-war) on project birt: Error assembling WAR: webxml attribute is required (or pre->existing WEB-INF/web.xml if executing in update mode)
I assume this error is caused by the fact that there is no such folder (/src/main/webapp) in my project. The structure of my project is the following:
drwxrwxr-x 3 kewei kewei 4096 12 avril 15:55 build
-rw-rw-r-- 1 kewei kewei 375 12 avril 16:10 pom.xml
drwxrwxr-x 3 kewei kewei 4096 12 avril 15:54 src
drwxrwxr-x 5 kewei kewei 4096 12 avril 16:12 target
drwxrwxr-x 10 kewei kewei 4096 12 avril 15:55 WebContent
There is nothing in the src folder and everything is in the WebContent folder.
I could do this job by changing the properties file and exporting the project to a war file (without maven). But is there a smarter way?
Maybe maven is not designed to do this kind of build? In this case, how can I build different wars by changing dynamically the content of properties file according to diffrent profiles?
Thanks!