How I can create file and put it in a war with Maven when building the war?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I'm assuming that you want a file that gets put on the classpath when your .jar or .war is assembled. You likely want to put it in
src\main\resources
.assuming your using eclipse+maven. put it Java resources>> package you want
then right click on the project maven>> update project. run the new pom.xml you'll get the new .war with everything in place.
Maven builds a war by executing the war goal of the maven-war plugin. Have a look at the configuration parameters of this goal at http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html.
Basically, warSourceDirectory (defaulting to ${basedir}/src/main/webapp) contains the files that go to the war, apart from your java code and resources. Fine tune with packagingIncludes/packagingExcludes. To include file(s) from another module, use overlay: http://maven.apache.org/plugins/maven-war-plugin/overlays.html.