Where to put Thorntail Swarm Configuration (project-defaults.yml) within a multi module Gradle project? - wildfly-swarm

I'm trying to configure the Swarm AS based on Thorntail 2.5.0.Final with a project-defaults.yml within a multi-module Gradle project. Unfortunately the configuration file doesn't get picked up.
Where do I have to put the project-defaults.yml file so it's registered by Thorntail?
Currently the situation looks like this:
I think the sub module resources folder is not correct, because this configuration file should configure the whole AS, right?

The file belongs to src/main/resources. It seems you already have one there -- are the two different?
If you have a multi-module project, generally there should be one module that builds the uberjar, and that module should have src/main/resources/project-defaults.yml.

Related

How can I share files (HTML templates) between App Engine modules?

I am using the Go runtime of Google App Engine and have two modules. I would like to share HTML templates between them but don't the best way.
My modules are organised as below:
src/github.com/myproject/moduleone/app.yaml
src/github.com/myproject/moduleone/templates/base.html
src/github.com/myproject/moduleone/templates/homeone.html
src/github.com/myproject/moduletwo/app.yaml
src/github.com/myproject/moduletwo/templates/base.html
src/github.com/myproject/moduletwo/templates/hometwo.html
In my situation base.html is the same for moduleone and moduletwo. How can I share it between both modules without having to duplicate the file as is done now?
I would like to put base.html in a directory called src/github.com/myproject/templates but I believe neither moduleone or moduletwo would be able to access the file as it's not in the same or child directory of the module app.yaml files. Is my only option to symlink the base.html file between each module's template directory?
GAE regards each module as a standalone application (each will run in its own GAE instance). No uploadable artifacts are shared at GAE level between the modules, each such artifact needs to be separately uploaded in each module using it.
While other approaches are technically possible (as other mentioned) symlinking the files is IMHO the simplest solution to avoid code duplication in your own repo.
You could copy the templates to each module as part of a build step and gitignore the copied files.

Deploying multiple modules using 'gcloud preview app deploy'

I currently have an app containing two modules, each with its own version number. When I run 'gcloud preview app deploy module1/app.yaml module2/app.yaml' I get the following error:
One or more files have conflicting settings for the [version] field.
If these version numbers need to be the same, is there a way to separately version your modules or is this not supported?
So it looks like I should not be naming my module configuration files 'app.yaml' (a reserved name). By naming the files 'module1.yaml' and 'module2.yaml' the problem was resolved.

Not able to start the bundle in servicemix

I have a bundle up and running in Servicemix. I went to my company's repository and downloaded the corresponding JAR to my local machine. I extracted that JAR and found out that this JAR had only one folder META-INF.
Inside this folder, there is a Manifest.mf file and my resources such as Spring configuration file and Camel Context file.
there I got my first question: where are the source files of this JAR i.e. JAVA classes and all. Only thing I saw there was manifest file, pom.xml, another pom properties file and couple of other configuration files for spring and camel.
this led to my next step. I had a local copy of this project in my workspace as well. I build this project locally and found the JAR in target directory of the project.
Now following steps might seem silly but anyway I did little experiment. I extracted this JAR which I found in target and extracted it to see the content. I believed it was a bundle because I used maven-bundle-plugin and there is no way you could tell by looking at a JAR that its just a JAR or an OSGI bundle. ok so I extracted the JAR and guess what this time it did have the compiled java classes.
this is not the end, I did something silly again. I removed the compiled classes from this JAR and made it exactly same as which I copied from my Company's central repository. Now I used a JDK's JAR creation utility to create a JAR.
Now I have two JARS:
one which I downloaded from company's central repo.
another one which I created myself. it has exactly same content as the other one. I even used the same manifest.mf while creating this JAR. (Since I knew Manifest is the backbone of an oSGI Bundle).
I secure copied this bundle in my server's home directory. and finally, I installed this Bundle/JAR in Servicemix using :
install file:path_to_JAR/JAR_FILE_NAME.
it got installed successfully. but when I tried to start this bundle. it could not start. by using display-exception, I saw the exception : it wasnt able to load the beans and could not
initialize the Application Context followed by a more specific exception "ClassNotFound" exception. I understand that it wasnt able to find the classes defined in my application context. BUT WHYYYYYYYYYY?
I did exactly same steps and I checked it multiple times. if mine could not start, why the earlier one is up and running.
It might sound silly for others who have worked in OSGI environment, But now I am starting to re consider especially ServiceMix.
Thanks for any suggestion.
This is nothing about OSGi, it's more something about your application.
As I don't know your project I just can do some assumptions.
First the jar you got from the Company Repository is most likely an "older" version and not the same as your local sources. With Servicemix it's quite possible to just have blueprint or spring xmls in your bundle cause those are valid resources a Camel-Blueprint/Spring extender are able to pick up. Those XMLs are interpreted and if those only make use of standard Camel Components there is no reason to have a single Class inside your bundle.
Now back to your newly created Bundle, obviously you have some new "Code" in your camel-xml which requires not only standard Camel classes but also some Processes you created on your own, now those classes need to stay in the Bundle!
Best just deploy the newly created Bundle with all it's classes. You should rather check what has changed in the camel xml files.

Maven Plugin Working Directory Not Constant

I wrote a Maven Plugin that creates some XML files on the classpath of my project. The Maven Project is fairly complex and has one master project with many sub projects (think services for a larger application).
The plugin takes a directory argument in the pom.xml, which is something relative to the classpath like this:
<docDestination>src/main/webapp/static/</docDestination>
However, when I try to access this folder via new File(docDestination), the resulting directory depends on the project (or sub-project) from which I ran the mvn install command that triggered the plugin.
The plugin is only specified in the pom.xml of one of the sub-projects, but if I run mvn-install from the parent it creates the XML files in the src/main/... folder of the parent application. How do I get the plugin to use the filesystem of the project in which it is declared rather than the filesystem of the parent project?
I should note that if I navigate to the sub-project in Terminal and run mvn install in that directory the files are created in the right place, which explains the title of my post.
Use the ${basedir} variable:
<docDestination>${basedir}/src/main/webapp/static</docDestination>
This should use the basedir currently used by the respective module (regardless of whether this is the top-level or a sub-module).

Including an assembly with your DotNetNuke Module?

I'm developing a DotNetNuke Module using the nonIIS method of module development. Is there any way to include a 3rd-party assembly in your module (when setting it up for deployment)?
I thought about adding it as a reference to the dotnetnuke_nonIIS website project as a whole, but that doesn't seem right considering it's a dependency of the module.
Whatever your local development environment may look like, you will most likely want to be able to deploy the module to a DNN site on its own.
To do that, you can create an installable module zip package - which consists of all of your module assets and a manifest file describing them so that DNN may process them and perform the appropriate actions (run scripts, deploy assemblies to the bin) upon installation.
Check out the DNN wiki for more information about packaging.

Resources