I have a webapp that is built via SBT and is deployed into Amazon Elastic Beanstalk. In order to configure Beanstalk instance, one needs to put .ebextensions folder with config files into root of WAR file. However, putting this folder into src/main/webapp doesn't help, because SBT by default ignores all hidden folders, so resulting WAR doesn't contain the folder.
Is there some way to configure SBT to include this folder into the build, besides it's hidden? Or how can I put this folder into the build some other way? I'm using jenkins to automate build and deploy so unpack - add folder - pack again isn't really an option, unless it can be somehow scripted. Thanks!
The web plugin appears to respect excludeFilter, which is by default:
excludeFilter := HiddenFileFilter
You can redefine it to allow .ebextensions:
excludeFilter := HiddenFileFilter -- ".ebextensions"
Related
I change the code in repo carbon-apimgt, and i run command "mvn clean install -Dmaven.test.skip=true" , I get a jar from target, what's next to apply this change?
Plugins directory is where we keep all the jars of components that are used in the product. Patches directory is used to track the changes done to each jar. What it does is, when you add a directory (eg: patch0001/) and add a jar to this new directory (eg: patch0001/org.wso2.carbon.apimgt.api_9.0.174.jar), this will replace the same-named jar that is found in the plugins directory.
Before this replacement, the server will first backup all the jars that are found in the plugins directory to a new folder patch0000 inside the patch folder.
At each startup, server will first apply the jars in the patch0000 directory and start replacing the jars by increasing the counter of each patch folder. (eg: patch0000, then patch0001, patch0002 up to patch9999).
This is the difference between the plugins directory and patch directory. If you replace a jar in the plugins directory, this is not a backward compatible change. However, if you replace a jar using this patch mechanism, whenever you remove the patch0001 directory from the system, this change will be reverted and the original jar will be preserved.
I'm working on an SBT project that has to be built with the options like:
-Xmx2G -Xss256M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
This means that every new developer has to read the readme and assign the options to SBT_OPTS in bash profile or put them in the sbtopts file. Similarly, this has to be configured on Jenkins and this applies to all the projects (so if someone wants to use -XX:+UseG1GC with other projects it becomes an issue). Is it possible to specify the required options in the build file itself? This seems logical to me, as the options are project-specific and without them, you cannot build the project.
Create a .sbtopts file at the root of the build with contents:
-J-Xmx2G
-J-Xss256M
-J-XX:+UseConcMarkSweepGC
-J-XX:+CMSClassUnloadingEnabled
Could someone please explain how one uses the premake extensions. I added the eclipse extension in a directory under my premake installation. And in the premake script I added recuire "eclipse".
Running the script with premake5 eclipse, I get an error module "eclipse.lua" not found.
I added the path of the modules directory to my environment variables.
I'm using premake (premake5) on Windows 8.
Thanks
addons need to reside in a folder. You need to create a "eclipse" folder, then copy all the files in it, and the "eclipse" folder should be located where premake can load it (either next the executable or some other place handled through environment variables)
I got this working by adding the full path to the require statement.
require "C:/premake/eclipse/eclipse"
and running the command as premake5 eclipse
Note: This plugin does not generate project files that one can import into Eclipse.
I use sbt 0.13.5 to build a project with a few config files meant to be human-edited after deployment.
Using sbt-native-packager's stage command builds my basic output directory structure for deployment. This results in a bin folder with a start script and all my jars in a lib folder. Great.
That just leaves the text config files that should be copied into a conf folder verbatim alonside the bin/ and lib/ folders (not included in any jar).
How can I copy these configuration files to the output directory on the filesystem (not into any jars) using sbt?
I'm unsure about an out-of-the-box support for src/main/conf directory or similar, and unless you find it, use the following as a workaround:
packageArchetype.java_application
mappings in Universal ++= {
((sourceDirectory in Compile).value / "conf" * "*").get.map { f =>
f -> s"conf/${f.name}"
}
}
It maps files under src/main/conf to conf directory in the package.
NB: I'm pretty sure I've seen somewhere in the code support for the conf directory.
Default Universal convention is to copy files/directories under src/univeral/. So, to include a conf/ directory in the distribution, just add src/universal/conf and copy configuration files there. Credit: this link
This seems to be a 'better' answer, as I am using sbt together with sbt-native-packager plugin:
mappings in Universal ++= contentOf( baseDirectory.value / "conf" )
This takes all the files under the specified "conf" folder and dumps them in the package root folder.
Which uses the MappingsHelper I stumbled upon in the very terse documentation for it in the sbt-native-packager.
If I install any grunt plugin, it is added to a folder named "node_modules" in the root of my project dir per default.
My question: is it possible to move this whole folder (and therefore all plugins) to another location (but still within my project folder), let's say to "build/node_modules" ?
Of course, I still want to be able to run grunt from anywhere in my project hierarchy after this change.
Nope, that's a feature of the Node.JS core files. In the case you don't know, Node.JS is the platform which Grunt was built.
All require() calls which don't point to an absolute file or start with ./ will try to find modules inside node_modules folders.
You can use symbolic link ln -s /original_node_modules_path/node_modules ./node_modules