Search code examples
mavenmulemaven-pluginmaven-assembly-plugin

How to add folder inside src/main/app in Mule project directly inside zip file and not in classes when building using maven


I have a folder named webapps inside my src/main/app in mule project. This webapps folder contains a war which is exposed in mule-config.xml through jetty connector. I tried lot of combinations in my maven build but this webapps folder ends up inside classes in zip file. I want it right inside zip.

Any pointers how to achieve it in pom?


Solution

  • Since couldn't get maven to build zip file in a way that it would copy webapps folder directly under root. I ended up placing webapps folder containing war file inside src/main/resources. Maven build copied webapps folder under classes. And the mule-config referred it as

    <jetty:connector name="Jetty" doc:name="Jetty">
        <jetty:webapps port="${jetty.port}" host="${jetty.host}" directory="${app.home}/classes/webapps" /> 
    </jetty:connector>