Libraries
Every library consists of component models and class definitions. Libraries are distributed as JAR files, and MontiArc provides means to automatically resolve and include different library dependencies by using Gradle.
For a list of all publicly available libraries, go to Public Libraries.
The documentation for the standard library, which is included in every MontiArc project, can be seen here.
Using and Publishing Libraries
This section provides details on how to include libraries in your project and how to publish your own library such that it can be consumed by others. This guide assumes that you're using Gradle to manage your project.
Using
MontiArc dependencies are added like any other Gradle dependency.
Inside the dependencies block of your Gradle build file, you can use the montiarc
configuration.
dependencies {
// montiarc + Dependency Notation - GroupID : ArtifactID (Name) : Version
montiarc('<group>:<name>:<version>')
}
Publishing
The easiest way to publish your own components is by using maven repositories.
For that you need to enable the maven-publish
plugin in your project
and create a publishing config.
plugins {
`java-library`
`maven-publish`
id("montiarc-jsim") version "7.8.0-SNAPSHOT"
id("cd2pojo") version "7.8.0-SNAPSHOT"
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "de.montiarc.sample"
artifactId = "library"
version = "1.0"
from(components["java"])
}
}
}
Running gradle publish
will publish your library.
For more information about configuration and specifying the target repository, where the library is published to, see the official Gradle documentation.