pom.xml - Move a config file into etc folder(of Karaf) when a (Maven)bundle is deployed -


Whenever a bundle is deployed, then I want to transfer a CFG file to the Etc. folder of Carrefour. The Cfg file is done under src / main / resource. Tried the following in Pom, but it is not working.

  & lt; Plugin & gt; & Lt; Group & gt; Org.apache.maven.plugins & lt; / Group & gt; & Lt; ArtifactId & gt; Maven-antrun-plugin & lt; / ArtifactId> & Lt; Version & gt; 1.1 & lt; / Edition & gt; & Lt; Hanging & gt; & Lt; Execution & gt; & Lt; Step & gt; Posted & lt; / Step & gt; & Lt; Goals & gt; & Lt; Goal & gt; Run & lt; / Target & gt; & Lt; / Targets & gt; & Lt; Configuration & gt; & Lt; Functions & gt; & Lt; Echo & gt; Using env.test.properties & lt; / Echo & gt; & Lt; Copy file = "src / main / resources / test.cfg" tofile = "$ {env.KARAF_HOME} /etc/test.cfg" /> & Lt; / Functions & gt; & Lt; / Configuration & gt; & Lt; / Execution & gt; & Lt; / Hanging & gt; & Lt; / Plugin & gt;   

How can I do this?

One of the solutions can be: - Put your test.cfg file in a more specific folder . (For example: src / main / resources / cfg) - Use the Maven Resource Plugin

This Maven Step is an example based on Generate-Resource (in place of that step by deploying in your case) :

  & lt; Plugin & gt; & Lt; Group & gt; Org.apache.maven.plugins & lt; / Group & gt; & Lt; ArtifactId & gt; Maven-Resource-Plugin & lt; / ArtifactId> & Lt; Hanging & gt; & Lt; Execution & gt; & Lt; ID & gt; Copying karaf & lt; / Id & gt; & Lt; Step & gt; Generated resources & lt; / Step & gt; & Lt; Goals & gt; & Lt; Goal & gt; Copy-Resource & lt; / Target & gt; & Lt; / Targets & gt; & Lt; Configuration & gt; & Lt; Resources & gt; & Lt; Resources & gt; & Lt; Directory & gt; Src / home / resources / cfg & lt; / Directory & gt; & Lt; Filtering & gt; True & lt; / Filtering & gt; & Lt; / Resources & gt; & Lt; / Resources & gt; & Lt; OutputDirectory & gt; D: \ Apache-karaf-3.0.1 \ etc \ & lt; / OutputDirectory & gt; & Lt; / Configuration & gt; & Lt; / Execution & gt; & Lt; / Hanging & gt; & Lt; / Plugin & gt;    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -