forked from geonetwork/core-geonetwork
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use unpack to support use of schema plugins as artifacts (geonetwork#…
…4701) * Add choice to unpack or copy schema plugins * Consistently use 3.11.0-SNAPSHOT * Assemble schema plugins as zip archives and unpack into web * Update readme instructions and add-schema.sh * Add notes on how web-app is built * Include comments in all the filters for ease of comparison * Remove build process research from README.md into a core-geonetwork proposal * Remove submodule and Include iso19115-3 directly * Update example snippet in add-schema.sh * Add escapes so schema-plugins.dir is used in generated web/pom.xml unpack
- Loading branch information
1 parent
9433407
commit 4acb4aa
Showing
350 changed files
with
180,232 additions
and
155 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
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
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 |
---|---|---|
@@ -1,17 +1,124 @@ | ||
# Maven module containing schema plugins | ||
|
||
## Plugin structure | ||
## Schema Plugin Definition | ||
|
||
A schema plugin is composed off: | ||
1. `src/main/plugin/<folder>` contents: | ||
|
||
* `schema-ident.xml` required configuration file | ||
* schema definition `xsd` files | ||
* transformations `xsl` files | ||
|
||
See [GeoNetwork Manual](https://geonetwork-opensource.org/manuals/trunk/en/customizing-application/implementing-a-schema-plugin.html) | ||
|
||
* A configuration folder containing XML file for configuration, | ||
the schema as XSDs and a set of transformation (See http://geonetwork-opensource.org/manuals/trunk/eng/developer/schemaPlugins/index.html). | ||
2. `src/main/java` providing: | ||
|
||
* Optional: SchemaPlugin bean | ||
* Optional: ApplicationListener<ServerStartup> to auto install plugin | ||
|
||
* (optional) A SchemaPlugin bean | ||
3. Schema plugin `pom.xml` are asked to bundle their `src/main/plugin` into a `zip`: | ||
|
||
```xml | ||
<!-- package up plugin folder as a zip --> | ||
<plugin> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>plugin-assembly</id> | ||
<phase>package</phase> | ||
<goals><goal>single</goal></goals> | ||
<inherited>false</inherited> | ||
<configuration> | ||
<appendAssemblyId>false</appendAssemblyId> | ||
<descriptors> | ||
<descriptor>src/assembly/schema-plugin.xml</descriptor> | ||
</descriptors> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
``` | ||
|
||
4. Using a `src/assembly/schema-plugin.xml` assembly: | ||
|
||
```xml | ||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd"> | ||
<id>plugin</id> | ||
<includeBaseDirectory>false</includeBaseDirectory> | ||
<formats> | ||
<format>zip</format> | ||
</formats> | ||
<fileSets> | ||
<fileSet> | ||
<directory>src/main/plugin/</directory> | ||
<outputDirectory></outputDirectory> | ||
<useDefaultExcludes>true</useDefaultExcludes> | ||
</fileSet> | ||
</fileSets> | ||
</assembly> | ||
``` | ||
|
||
4. If you need to depend on any geonetwork modules please make use of `project.version` property: | ||
|
||
```xml | ||
<dependency> | ||
<groupId>org.geonetwork-opensource</groupId> | ||
<artifactId>common</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
``` | ||
|
||
## Add a plugin to the build | ||
5. The use of `project.version` is also required for schemas modules: | ||
|
||
To include a new schema plugin in a build, copy the schema folder | ||
here and add it to the copy-schemas execution in web/pom.xml. | ||
```xml | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.geonetwork-opensource.schemas</groupId> | ||
<artifactId>schema-core</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.geonetwork-opensource.schemas</groupId> | ||
<artifactId>schema-iso19139</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
``` | ||
|
||
5. Use `mvn install` to install your schema plugin in your local repository. | ||
|
||
## Optional: Add a plugin to the build | ||
|
||
While schema plugins can be built independently, they can be conditionally included in the build: | ||
|
||
1. Add schema plugin: | ||
|
||
* As a folder, using `.gitignore` to avoid accidentally committing: | ||
|
||
``` | ||
iso19139.xyz | ||
``` | ||
|
||
* As a git submodule if you are making a fork | ||
` | ||
2. Use a profile (activated by your schema plugin folder being present) to include your schema plugin to the list of modules in `pom.xml`. | ||
|
||
```xml | ||
<profiles> | ||
<profile> | ||
<id>schema-iso19139.xyz</id> | ||
<activation> | ||
<file> | ||
<exists>iso19139.xyz</exists> | ||
</file> | ||
</activation> | ||
<modules> | ||
<module>iso19139.xyz</module> | ||
</modules> | ||
</profile> | ||
</profiles> | ||
``` | ||
|
||
3. The `add-schema.sh` script automates these changes. | ||
|
Oops, something went wrong.