Magnolia 5.5.5 Indexing Config In Magnolia - maven

Right now I have my
indexing_configuration.xml
and my
workspace.xml
in my workspace/website folder. When I do a mvn clean the workspace will be reset resulting in this config disappearing.
How can I include the configuration in my magnolia project so that it gets installed when I redeploy?

In magnolia.properties file there is a parameter for setting jackrabbit configuration file, typically it's
magnolia.repositories.jackrabbit.config=WEB-INF/config/repo-conf/jackrabbit-bundle-derby-search.xml
In this file, you can set a custom path for configuration files. For indexing it's in SearchIndex section, param name indexingConfiguration.
If you want to use different configurations for different workspaces, you can add extra Workspace sections. But I haven't tried it yet.
Some documentation how it works you can find here: Jackrabbit Repository Configuration File

Related

Can we change .gradle path from Users location to project location in springboot?

Since I want to build project in Azure DSVM where there is not internet connectivity.
And I wanted to take all gradle dependencies to that machine. And build + run on the DSVM machine.
My project structure as follows
I wanted my spring gradle to download all dependencies into .gradle/ directory inside my project.
And link to this location only. So, that I can apply same settings into my target DSVM machine.
I dont have option to download jars from internet inside my DSVM, but I can copy those manually that is possible for me.
What settings I need to apply ?
I have fixed above issue by adding gradle.properties file inside USER_HOME/.gradle/
directory with following values :-
systemProp.http.proxyHost=<IP-Address>
systemProp.http.proxyPort=<Port>
systemProp.https.proxyHost=<IP-Address>
systemProp.https.proxyPort=<Port>
The IP Address & Port number should shared by respective Firewall network.

How to create multiple Maven m2 repositories for single user

I am setting up 2 jenkins instances on same server. I would like to create 2 local maven repositories for both jenkins seprately. Jenkins 1 is already set up and operational and I woudnt like to touch it.
Can we have 2 local maven repositories for single user as both jenkins are running as the same user ?
Is there any way I can point maven from jenkins to the new repository ?
Thanks
AI
Thanks for your replies, I figured it out, every maven command I am running, I am adding extra parameter
-Dmaven.repo.local=/path/to/alternate/local/repository/
and it overrides default local maven repository.
Cheers,
AI
You can specify a local repository in the settings.xml under <settings><localRepository>.
Alternatively, you can also specify it on the command line as described here:
https://stackoverflow.com/a/7071791/927493
Maven configuration occurs at 3 levels:
◾ Project - most static configuration occurs in pom.xml
◾ Installation - this is configuration added once for a Maven installation
◾ User - this is configuration specific to a particular user
Maven reads the settings from the settings.xml file which can be located in ${M2_HOME}/conf/settings.xml, as well as ${user.home}/.m2/settings.xml
<settings>
...
<localRepository>/path/to/local/repo/</localRepository>
...
</settings>
The default value for the local maven repository is ${user.home}/.m2/repository/
Even though you are are constrained in that you are using the same use for both Jenkins, remember the jobs run on nodes and those can be launched by different users (if via SSH), but it's that node's user's ${user.home}, not the user running Jenkins itself which is read (See Node note below).
What's the simplest way to get two different <localRepository> for a given user?
Jenkins has a Global Tool Configuration (${JENKINS_URL}/configureTools) for Maven:
Further down the the same page you must configure the Maven installations
You could choose the Global Tool Configuration | Maven Configuration to NOT use the default maven settings (the two mentioned above) and specify one from the filesystem:
One one instance, choose ${user.home}/.m2/settings.J1.xml, and on the other, choose ${user.home}/.m2/settings.J2.xml
Alternatively, you could even choose two different "Maven installations", with a different MAVEN_HOME, then have a different ${M2_HOME}/conf/settings.xml in each (awkward, but sometimes useful).
JOB SPECIFIC REPO?
But, if disk space is not really an issue, you could go a step further and give every single job its own private local repository. This is especially handy when building shared libraries in parallel, parallel branches and other scenarios using -SNAPSHOT. Under the Advanced ... options in the maven step, select [ X ] use private Maven repository. That repository ends up residing in ${WORKSPACE}/.repository. Suggest adding the Workspace Cleanup plugin to help manage your space.
You can also, on a per-job basis, specify a specific file-system settings.xml.
NODE SPECIFIC REPO?
Also, each Node has its own Node Properties which again let you customize the "Tool Locations". You can override the "(Maven) Home" location here (but not settings location).
[
PIPELINE
All this is also supported and configurable if using a Pipeline, as described in the Pipeline Maven Integration Plugin.
Extra Plugins
Finally, if you don't like the idea of having all these settings.xml lying all over the filesystems, you can install the Config File Provider plugin which lets you store the custom settings.xml within Jenkins. After installation, the Global Tool Configuration (shown) and Job steps now has the added option to choose from the "provided settings.xml" options you create:

How to modify the Netbeans Application Configuration?

I have a Maven Netbeans Application I want to modify its configuration. What do I need to do to change startup parameters from the conf file like: default_options?
I have to manually do it but would like to make it part of the build process.
You will have to create a netbeans.conf file in your nbm-application project and point the nbm-maven-plugin to it's location - please see http://mojo.codehaus.org/nbm-maven/nbm-maven-plugin/cluster-app-mojo.html#etcConfFile
Create your own ProjectName.conf, for example from default ProjectName.conf file.
Next place it in nbproject folder.
And add to project.conf line like this:
app.conf=nbproject/ProjectName.conf
Support for Custom Configuration Files in NetBeans

How to configure Typesafe Activator *a priori* to use an existing local Maven repository?

(Not found in the Activator documentation)
It seems that it is possible to have Activator also use an existing local Maven repository by adding the following entry (in bold) in file build.sbt:
resolvers += Seq(
"Local Maven Repository" at "file://q:/repositories/maven",
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
)
I am not sure it works but anyway, the problem with this approach is that the project structure must already have been created (and therefore a local repository created and automatically populated by downloads), hence my question : is it possible to tell Activator before it creates the project structure that it should use some local Maven repository ?
Thanks in advance for any hint.
Activator makes use of the sbt-launcher. You can use the sbt-launcher to control which repositories sbt makes use of by default for each project and for the launcher itself.
If you'd like to modify the activator launcher itself, unzip the jar file and take a look at the sbt/boot.properties file included. You can use the format outlined at sbt's launcher docs to add your local maven repository to the list.
A simpler option in the future (but not enabled in our current properties file) is the launcher's ability to have an override repository configuration file. See: Sbt's proxy configuration docs. This file would allow you to specify the repositories you wish activator to use by default. We disabled this to ensure the offline repository which activator uses is added by default. However, I'll open a ticket to re-enable this feature. That way, you should be able to just create a ~/.sbt/repositories file with the following contents:
[repositories]
activator-local: file://${activator.local.repository-${activator.home-${user.home}/.activator}/repository}, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
local
maven-local
maven-central
typesafe-releases: http://typesafe.artifactoryonline.com/typesafe/releases
typesafe-ivy-releases: http://typesafe.artifactoryonline.com/typesafe/ivy-releases, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
Note: the ~/.sbt/boot directory will always exist. This is created to ensure that no other process deletes jar files we use while running, so we copy these out of the local cache. If we didn't, you'd see some really fun error messages.

Config file sharing in mercurial and VS

Our project uses custom xml config file, that is currently located under the project as .xml file, with Copy to output: always. Currently, it is present in the repository.
The problem is that every developer uses each own database (and each own configuration file), so ideally we need to have different configuration files, and we do not want to commit them to the external repository.
Sometimes the format of the configuration file is changed, and all of us need to update it. Also we have a build server that is configured to clean the folder before updating source from the repository and building it, so the default file (configured for build server) should be contained in the repository.
The problems is that sometimes a dev forget to check out it's local copy of the configuration xml when building, and his own config file goes to repository and brake many things. Is there any way to improve this schema so we don't need to remove config file from commit files every time we commit?
My solution is to exclude the app.config from VCS to prevent accidental commits to it. We have created an app.example.config which is checked in. A pre-build event validates if the app.config file exists and if it does not copies the .template to the .config file before compile of the codebase. This ensures the build server has a working config file which contains basic settings for all environments.
Example for PRe-build event in your project configuration:
REM copy .example files to .config files if needed
IF NOT EXIST "$(projectDir)\App.Config" IF EXIST "$(projectDir)\app.example.config" COPY "$(projectDir)\app.example.config" "$(projectDir)\App.Config"
IF NOT EXIST "$(projectDir)\Web.Config" IF EXIST "$(projectDir)\Web.example.config" COPY "$(projectDir)\Web.example.config" "$(projectDir)\Web.Config"
IF NOT EXIST "$(projectDir)\ConnectionStrings.Config" IF EXIST "$(projectDir)\ConnectionStrings.example.config" COPY "$(projectDir)\ConnectionStrings.example.config" "$(projectDir)\ConnectionStrings.Config"
IF NOT EXIST "$(projectDir)\Local.Config" IF EXIST "$(projectDir)\Local.example.config" COPY "$(projectDir)\Local.example.config" "$(projectDir)\Local.Config"
Config in repo contain data for TeamCity
Developers have MQ and patch in MQ-stack for converting default xml to local
Changed base xml require to edit (rebase) patch and remove conflicts
Here's another answer similar to the accepted one by Mark, but using the <Copy> task in the .csproj file, which you were apparently looking for:
how to ignore files in kiln/mercurial using tortoise hg "that are part of the repository"

Resources