New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Play 'dist' artifact includes duplicate files #3473
Comments
Agreed, this is something I've never looked too carefully at, but I was aware there was some weirdness there. I don't think those files are added to the classpath at all. We could remove the mappings to include them, but I think some people depend on them being there and then they manually configure Play to point to them. The option is to include that conf directory on the classpath (and ensure it's first on the classpath), which is probably not a bad idea, but it does change existing behaviour. You can put it on the classpath in your build by doing something along the lines of this in import NativePackagerKeys._
scriptClasspath := "../conf" :+ scriptClasspath.value One problem with the above, I'm not sure if it will work on Windows - the generated batch script will probably end up with the forward slash, not sure how the JDK on Windows copes with that. |
This As an indication that this thing bites others as well, here are some issues I think are somewhat related:
That is what I found after a quick search. The point I'm trying to make here is: What is the purpose of the I would appreciate if we could somehow change the status quo and would propose to either remove the content or rename / move it somewhere where the purpose gets clearer. |
could not agree more with the troubles we had with this in prod. we find it very useful to change things like logger, connection strings etc even if in production. otherwise what's the point of including the conf dir? please make conf folder operational so that we could alter it's content and restart to see the effect. this refers to both regular conf files and logback configuration files! |
The problem is that I personally think the best solution here would be to stop using this directory for two different things. I would create a new directory called If we split the current |
* conf directory in dist artifact is now added to the classpath by default * Added externalizeResources SBT setting to turn off including the conf directory as an external (as in, not in the applications jar) directory and including it in the classpath * Added --no-exit-sbt flag to Play start and stop commands to help with scripted tests * Updated distribution scripted test, which now tests running Play in prod mode, as well as testing if the conf directory is on the classpath. Fixes playframework#3473
* conf directory in dist artifact is now added to the classpath by default * Added externalizeResources SBT setting to turn off including the conf directory as an external (as in, not in the applications jar) directory and including it in the classpath * Added --no-exit-sbt flag to Play start and stop commands to help with scripted tests * Updated distribution scripted test, which now tests running Play in prod mode, as well as testing if the conf directory is on the classpath. Fixes playframework#3473
* conf directory in dist artifact is now added to the classpath by default * Added externalizeResources SBT setting to turn off including the conf directory as an external (as in, not in the applications jar) directory and including it in the classpath * Added --no-exit-sbt flag to Play start and stop commands to help with scripted tests * Updated distribution scripted test, which now tests running Play in prod mode, as well as testing if the conf directory is on the classpath. Fixes playframework#3473
* conf directory in dist artifact is now added to the classpath by default * Added externalizeResources SBT setting to turn off including the conf directory as an external (as in, not in the applications jar) directory and including it in the classpath * Added --no-exit-sbt flag to Play start and stop commands to help with scripted tests * Updated distribution scripted test, which now tests running Play in prod mode, as well as testing if the conf directory is on the classpath. Fixes playframework#3473
* conf directory in dist artifact is now added to the classpath by default * Added externalizeResources SBT setting to turn off including the conf directory as an external (as in, not in the applications jar) directory and including it in the classpath * Added --no-exit-sbt flag to Play start and stop commands to help with scripted tests * Updated distribution scripted test, which now tests running Play in prod mode, as well as testing if the conf directory is on the classpath. Fixes playframework#3473
Running the 'dist' sbt task creates a zip which is said to be the way to deploy to production. However, this zip contains duplicate files, for example both a fully stocked /conf directory at top level, and contained within the project's jar bundled under lib. In addition to unneccesary bloat, this can cause confusion when wanting to make a quick manual change to a server running in "production" mode (which might well be a test server or something else). The presence of the file at top level makes one assume that editing and restarting the app will make a change, when it may not depending on the class loading order (if it is even on the classpath to begin with). Issue #3472 was mistakenly reported due to this.
The raw files should be excluded since this is a production deploy, but if they are going to be there then they should be on the classpath first.
The text was updated successfully, but these errors were encountered: