How to bootstrap Jackrabbit from code - repository

I am trying to run jackrabbit repository from the application. Is there any way to bootstrap jackrabbit to start the repository. I couldn't with any deployment models mentioned in jackrabbit manual as I need to take the repository location dynamically from database. Am looking for stating/shutting the repository from java code.

You have 2 options there :
obtain the connection parameters from your database and use JcrUtils to connect to the repository.
start your repository which requires the configuration file (repository.xml) and the home directory of your repository. You have some example in Silverpeas code.

Related

Can I deploy bamboo.yml YAML specs manually?

I am trying to learn how YAML specs works in Bamboo. So far I achieved to deploy the plan following the official documentation. enter link description here
The documentation explains that you need to create a bitbucket repository, create bamboo.yml, set a new project in bamboo, enable a bamboo specs repository and finally you get your plan created and based in YAML specs.
My question is, can I create a plan.yml and deploy it from other bamboo plan?
For example, for JAVA specs, it is enough to checkout a repo with several *.java specs files and use maven and a pom file to deploy all the plans.
Can I do something similar with YAML specs? To have a folder in some SCM with several *.yml files and deploy them simultaneously. As a result, to have a lot of plans in bamboo deployed and based on the yml files.
yes and no, yaml can't be sent to the server as you can do with java specs. It needs to be committed to the repo first
you also need to have your different project created prior to committing the yaml specs and or have that repo granted access to each individual project or enabled the flag on the linked repo to allow access to all projects in the specs tab.
if this is not an issue,then yes there is no problem defining multiple plans in your bamboo specs yml file, even across multiple projects, as long as they are split up in separate yaml documents (with "---")

How to Provision Bundle committed through HTTP API in Apache Ace

I am committing a bundle(say Test.jar) to the Apache Ace Repository using the HTTP API, http://<Ace Host>/repository/commit?customer=apache&name=shop&version=2. After this how can i provision this bundle to a target?
I am a bit puzzled by your question because the repository you mention contains metadata (in XML format) that describes the relationship between artifacts (bundles or other files), features and distributions. You should not commit bundles to it. Bundles go in the OBR, which has its own REST API if you programmatically want to upload them.
To provision a bundle to a target, using the Web UI, you:
Upload the bundle as a new artifact. It will be sent to the OBR and show up in the artifacts column.
Associate the artifact with a feature and the feature with a distribution.
Launch an new target and watch it show up in the UI (you might need to "retrieve" the current configuration for that to happen).
Associate the distribution with the target.
Commit everything.

How to make a maven project buildable for the customer

We have a project which should be buildable by the customer using maven. It has some open source dependencies that are mavenized (no problem), some that aren't mavenized, proprietary stuff (oracle jdbc driver) and some internal stuff.
Until now we had everything but the first category packaged with the project itself in a local repository (repository with file://path-in-project-folder specified in the projects pom.xml).
We would love to move these out of the project, as we are about to use them in other projects as well. Currently we plan to use nexus as an internal maven repository.
Whats the best practice to make such dependencies/maven repositories available to the customer so he can continue to build the project.
Ideas so far:
Customer sets up a nexus repository as well, we somehow deploy all these non-public dependencies to his repository (like a mirror)
We provide a 'dumb' dump/snapshot of the non-public dependencies, customer adds this snapshot to this settings.xml as a repository, (but how is this possible).
Make our internal nexus repo available to the customers build server (not an option in our case)
I'm wondering how others solve these problems.
Thank you!
Of course, hosting a repository of some kind is a straightforward option, as long as you can cover the uptime / bandwidth / authentication requirements.
If you're looking to ship physical artifacts, you'll find this pattern helpful: https://brettporter.wordpress.com/2009/06/10/a-maven-friendly-pattern-for-storing-dependencies-in-version-control/
That relies on the repository being created in source control - if you want a project to build a repository, consider something like: http://svn.apache.org/viewvc/incubator/npanday/trunk/dist/npanday-repository-builder/pom.xml?revision=1139488&view=markup (using the assembly plugin's capability to build a repository).
Basically, by building a repository you can ship that with the source code and use file:// to reference it from within the build.
There are two options:
Document exactly what artifacts you need to compile which are not
available via Maven Central
Implement Nexus and make a export with Nexus give the export
to customer and they need to do a import of it. I'm not sure
if you come to licenses issues.
I assumed that you already have a Repository Manager already but it reads like you didn't.

Nexus: Configure jarvana as a remote repository -- what's the URL?

I'm converting an Ant build system to use a local Nexus mirror (1.3.6), and can't seem to get Nexus to proxy Jarvana repository. One of our dependencies is jython 2.5, which is available only on Jarvana.
I had no problem configuring other repository proxies, such as java.net at http://download.java.net/maven/2/
For Jarvana I've tried
www.jarvana.com/
www.jarvana.com/jarvana/
www.jarvana.com/maven2/
www.jarvana.com/maven/2/
www.jarvana.com/browse/
In all cases, the browse pane shows .index and .meta folders, and the .index is populated with nexus-maven-repository-index-* files, but searching for jython returns only the earlier (2.2 and prior) versions from Maven Central.
Am I using the wrong URL, and if so what URL should I be using?
Jarvana offers maven repository search capabilities and maven repository browse capabilities, but it does not offer a direct URL for its repository files. This is because all Jarvana files come from the maven central repository, so every file in Jarvana should be available in the maven central repository.
As an example, Jython 2.5 is available in the central repository at:
repo1.maven.org/maven2/org/python/jython/2.5.0/
Update: I did a bit more digging and it looks like the repository URL for Jarvana is http://www.jarvana.com/jarvana/browse. I've just added Jarvana as a proxy repository with that URL and successfully downloaded Jython 2.5.

How do I set up the JBoss Maven repository in NetBeans 6.5?

I tried to configure the Maven plug in (version 4) to add the JBoss Maven repository at http://repository.jboss.com/maven2/ following the guide at http://wiki.netbeans.org/MavenBestPractices#section-MavenBestPractices-UtilizingAndManagingMavenRepositories.
The new repository appears in the list of Maven repositories, but I can not see any items (artifacts), updating the index does not help.
It looks like a problem with the Maven plug in. Maybe it requires an ".index" subdirectory which is not available on the JBoss server.
The JBoss repository has a Nexus index at http://repository.jboss.com/maven2/.index/. I think the problem is that Netbeans might not be making use of this index. I would recommend installing Nexus, adding the JBoss repo to a public group and then pointing your Netbeans instance at a local instance of Nexus.
Download Nexus from http://nexus.sonatype.org
Install it by unpacking the tar.gz or zip on your machine
Fire it up by running bin/jsw//nexus start
Go to http://localhost:8081/nexus
Log in as the default admin user: admin/admin123 is the username/password
Click on Repositories
Click the Add... button
Add a new repository for the JBoss repositorywith a remote location of: http://repository.jboss.com/maven2/
Save the new repository. (You will also want to make sure that Download remote index is selected)
Add the repository to your public group by clicking on the public group and dragging the new JBoss repository to the selected repositories.
Configure your ~/.m2/settings.xml file to have the same contents as: http://www.sonatype.com/books/nexus-book/reference/maven-sect-single-group.html
At that point, all of your repository requests are going to flow through Nexus. Nexus already ships with proxy repositories for Central. So all you did was to add in the JBoss repository and then add it to the public group. Once you do this, you'll find that your builds are going to be much, much faster.