- Java 11+
Download latest version as precompiled JAR
<dependency>
<groupId>de.fraunhofer.iosb.ilt.faaast.service</groupId>
<artifactId>starter</artifactId>
<version>0.2.1</version>
</dependency>
implementation 'de.fraunhofer.iosb.ilt.faaast.service:starter:0.2.1'
A maven plugin we are using in our build script leads to an error while resolving the dependency tree in gradle. Therefore you need to add following code snippet in your build.gradle
. This code snippet removes the classifier of the transitive dependency com.google.inject:guice
.
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.module.toString() == "com.google.inject:guice") {
details.artifactSelection{
it.selectArtifact(DependencyArtifact.DEFAULT_TYPE, null, null);
}
}
}
}
- Maven
git clone https://github.com/FraunhoferIOSB/FAAAST-Service
cd FAAAST-Service
mvn clean install
This example shows how to start a FA³ST Service given your custom AAS model (called model.json
for simplicity but can be any relative or absolute path to an AAS model in any supported data format, e.g. JSON, XML, RDF or AASX). The service will expose an HTTP endpoint on default port 8080.
cd /starter/target
java -jar starter-{version}.jar -m model.json
Service service = new Service(ServiceConfig.builder()
.core(CoreConfig.builder()
.requestHandlerThreadPoolSize(2)
.build())
.persistence(PersistenceInMemoryConfig.builder()
.environment(AASEnvironmentHelper
.fromFile(new File("{pathTo}\\FAAAST-Service\\misc\\examples\\demoAAS.json")))
.build())
.endpoint(HttpEndpointConfig.builder().build())
.messageBus(MessageBusInternalConfig.builder().build())
.build());
service.start();