In the main pom.xml of the project, in the repositories section, add this repository if it is not configured there yet.
<repository> <id>hippo-forge</id> <name>Bloomreach Forge maven 2 repository.</name> <url>https://maven.onehippo.com/maven2-forge/</url> <snapshots> <enabled>false</enabled> </snapshots> <releases> <updatePolicy>never</updatePolicy> </releases> <layout>default</layout> </repository>
In the main pom.xml of the project, in the properties section, add this property. For the correct version number, check the Release Notes page.
<forge.jcrrunner.version>version.number</forge.jcrrunner.version>
Preferred way is to get the code as Maven dependency into your project.
<dependency> <groupId>org.onehippo.forge.jcrrunner</groupId> <artifactId>jcrrunner</artifactId> <version>${forge.jcrrunner.version}</version> </dependency>
Fork me on GitHub: https://github.com/bloomreach-forge/jcr-runner.
Build the project using Maven:
$ mvn clean install
You can also execute it:
mvn clean compile exec:java
After the first run you can use the slightly faster command
mvn -o -q compile exec:java
In the (absolute) path * and ** can be used. For example:
repository.path=/content/documents/*/2009/**
This will match /content/documents/[any path element]/2009/[everything below]
repository.query.language=xpath
Specify the query language, in this case "xpath"
repository.query=content/gallery//element(*, hippogallery:imageset)
This will match all document; within path "content/gallery which are of the type "hippogallery:imageset"
# repository configuration repository.url=rmi://127.0.0.1:1099/hipporepository repository.user=admin repository.pass=admin # everything that starts with /content/documents repository.path=/content/documents/** # Java plugins plugins.java.logplugin.class=org.onehippo.forge.jcrrunner.plugins.LoggingPlugin
# repository configuration repository.url=rmi://127.0.0.1:1099/hipporepository repository.user=admin repository.pass=admin repository.query.language=xpath repository.query=content/gallery//element(*, hippogallery:imageset) # Java plugins plugins.java.logplugin.class=org.onehippo.forge.jcrrunner.plugins.LoggingPlugin