-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #608 from ontodev/context
Add maven plugin to update OBO context
- Loading branch information
Showing
5 changed files
with
314 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# ROBOT Maven Plugins | ||
|
||
This directory contains additional `mvn` plugins specific to ROBOT. | ||
|
||
Before using these plugins, you must install the JAR: | ||
``` | ||
mvn install | ||
``` | ||
|
||
## ROBOT Plugins | ||
|
||
### Update Context | ||
|
||
This plugin updates the [`obo_context.jsonld`](https://raw.githubusercontent.com/ontodev/robot/master/robot-core/src/main/resources/obo_context.jsonld) file with the most current prefixes from the [OBO Foundry context file](https://raw.githubusercontent.com/OBOFoundry/OBOFoundry.github.io/master/registry/obo_context.jsonld). You must be connected to the internet to run this plugin. | ||
|
||
This can be run from either this directory, or the root `robot` directory: | ||
``` | ||
mvn robot:UpdateContext -N | ||
``` | ||
|
||
The `-N` flag is recommended so that the plugin does not run multiple times for each child module. | ||
|
||
--- | ||
|
||
## Creating New Plugins | ||
|
||
Add new plugins `src/main/java/org.obolibrary.robot` directory following this filename convention: `{plugin-name}Mojo.java`. | ||
|
||
These new Java classes must extend the `AbstractMojo` class and have an `execute()` method. A `@Mojo` annotation is also required to specify the name of the plugin. | ||
``` | ||
@Mojo(name = "MyNewPlugin") | ||
public class MyNewPluginMojo extends AbstractMojo { | ||
public void execute() { | ||
// Do stuff | ||
} | ||
} | ||
``` | ||
|
||
For more information on plugin development, [see here](https://maven.apache.org/guides/plugin/guide-java-plugin-development.html). | ||
|
||
Then, install the new JAR for this module: | ||
``` | ||
mvn install | ||
``` | ||
|
||
Now you can run your plugin from the command line anywhere within this repo: | ||
``` | ||
mvn robot:MyNewPlugin -N | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.obolibrary.robot</groupId> | ||
<artifactId>robot</artifactId> | ||
<version>1.6.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>robot-maven-plugin</artifactId> | ||
<version>1.6.0-SNAPSHOT</version> | ||
<packaging>maven-plugin</packaging> | ||
<name>robot-maven-plugin</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.maven</groupId> | ||
<artifactId>maven-plugin-api</artifactId> | ||
<version>3.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.maven.plugin-tools</groupId> | ||
<artifactId>maven-plugin-annotations</artifactId> | ||
<version>3.4</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-plugin-plugin</artifactId> | ||
<version>3.3</version> | ||
</plugin> | ||
|
||
<!-- Enforce Google Java Style --> | ||
<plugin> | ||
<groupId>com.coveo</groupId> | ||
<artifactId>fmt-maven-plugin</artifactId> | ||
<version>2.1.0</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>format</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.obolibrary.robot</groupId> | ||
<artifactId>robot-maven-plugin</artifactId> | ||
<version>1.6.0-SNAPSHOT</version> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
Oops, something went wrong.