A
A
Alexey Kopendakov2019-03-07 14:58:28
Java
Alexey Kopendakov, 2019-03-07 14:58:28

How to remove settings files from jar?

Good afternoon.
Ask such a question. I'm building a console application using "mvn compile assembly:single". The output is 1 jar file. And how can you take out the settings files: persistence.xml, log4j.properties from under the jar?
I would still like not to recompile the application every time I need to change the settings ....

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2019-03-07
@alex_kag

  1. Write code so that resources are searched first in the CLASSPATH root, and if they are not found there, then in a specific subdirectory;
    The files in the current directory will be found first and will override the default files packaged in the jar.

A
Alexey, 2016-10-30
@game802

Try

$label = preg_replace('/^.*?\((.*)\).*?$/i', '$1', $filename);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question