Commit 83b2748b authored by Günter Hipler's avatar Günter Hipler
Browse files

refactoring (changed package structure and changed assembly rules) to

fix the class not found error during start of the service
parent bc122520
Pipeline #23126 passed with stages
in 6 minutes and 34 seconds
import Dependencies.{rioapijsonld, rioapintriples, rioapiturtle, _}
import Dependencies._
ThisBuild / scalaVersion := "2.13.3"
ThisBuild / version := "0.1.0-SNAPSHOT"
......@@ -13,14 +13,15 @@ lazy val root = (project in file("."))
.settings(
name := "rico2edm",
assemblyJarName in assembly := "app.jar",
mainClass in assembly := Some("ch.memobase.Main"),
mainClass in assembly := Some("ch.memobase.rico2edm.Main"),
test in assembly := {},
assemblyMergeStrategy in assembly := {
//case "log4j.properties" => MergeStrategy.first
//case "module-info.class" => MergeStrategy.discard
//case "log4j2.xml" => MergeStrategy.first
case "META-INF/MANIFEST.MF" => MergeStrategy.discard
//case _ => MergeStrategy.last
case "log4j.properties" => MergeStrategy.first
case "module-info.class" => MergeStrategy.discard
case "log4j2.xml" => MergeStrategy.first
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
},
//assemblyExcludedJars in assembly := {
......
......@@ -26,8 +26,8 @@ object Dependencies {
lazy val jenaV = "3.17.0"
lazy val rdf4jV = "3.5.1"
lazy val iiifApis = "de.digitalcollections.iiif" % "iiif-apis" % "0.3.8"
lazy val iiifPresentationApi =
//lazy val iiifApis = "de.digitalcollections.iiif" % "iiif-apis" % "0.3.8"
//lazy val iiifPresentationApi =
"ch.memobase.iiif" % "iiif-presentation-api-v3" % "0.0.1"
lazy val kafkaStreams = "org.apache.kafka" %% "kafka-streams-scala" % kafkaV
lazy val kafkaStreamsTestUtils =
......@@ -42,15 +42,15 @@ object Dependencies {
lazy val scalaTest = "org.scalatest" %% "scalatest" % scalatestV
lazy val upickle = "com.lihaoyi" %% "upickle" % "0.9.5"
lazy val jena = "org.apache.jena" % "jena-core" % jenaV
lazy val jsonld = "org.apache.jena" % "jena-arq" % jenaV
//lazy val jena = "org.apache.jena" % "jena-core" % jenaV
//lazy val jsonld = "org.apache.jena" % "jena-arq" % jenaV
lazy val rdf4jmodel = "org.eclipse.rdf4j" % "rdf4j-model" % rdf4jV
lazy val rioapi = "org.eclipse.rdf4j" % "rdf4j-rio-api" % rdf4jV
lazy val rioapixml = "org.eclipse.rdf4j" % "rdf4j-rio-rdfxml" % rdf4jV
lazy val rioapiturtle = "org.eclipse.rdf4j" % "rdf4j-rio-turtle" % rdf4jV
lazy val rioapijsonld = "org.eclipse.rdf4j" % "rdf4j-rio-jsonld" % rdf4jV
lazy val rioapintriples = "org.eclipse.rdf4j" % "rdf4j-rio-ntriples" % rdf4jV
//lazy val rioapiturtle = "org.eclipse.rdf4j" % "rdf4j-rio-turtle" % rdf4jV
//lazy val rioapijsonld = "org.eclipse.rdf4j" % "rdf4j-rio-jsonld" % rdf4jV
//lazy val rioapintriples = "org.eclipse.rdf4j" % "rdf4j-rio-ntriples" % rdf4jV
}
package ch.memobase.rdf.writer;
package ch.memobase.rico2edm.rdf.writer;
import org.eclipse.rdf4j.common.net.ParsedIRI;
import org.eclipse.rdf4j.common.xml.XMLUtil;
......
......@@ -17,15 +17,14 @@
*
*/
package ch.memobase
package ch.memobase.rico2edm
import ch.memobase.edm.EDM
import ch.memobase.rico2edm.edm.{EDM, ExtractionResult}
import org.apache.kafka.streams.Topology
import org.apache.kafka.streams.scala.ImplicitConversions._
import org.apache.kafka.streams.scala.kstream.KStream
import org.apache.kafka.streams.scala.{StreamsBuilder, _}
import org.apache.logging.log4j.scala.Logging
import ch.memobase.edm.ExtractionResult
import scala.util.Try
......
......@@ -17,11 +17,11 @@
*
*/
package ch.memobase
import ch.memobase.edm.Extractors
package ch.memobase.rico2edm
import scala.util.Try
import ch.memobase.rico2edm.edm.Extractors
object KafkaTopologyUtils {
......@@ -46,5 +46,4 @@ object KafkaTopologyUtils {
.isFailure
}
......@@ -17,18 +17,20 @@
*
*/
package ch.memobase
import java.time.Duration
package ch.memobase.rico2edm
import org.apache.kafka.streams.KafkaStreams
import org.apache.logging.log4j.scala.Logging
import org.memobase.settings.SettingsLoader
import scala.jdk.CollectionConverters._
import java.time.Duration
import scala.util.{Failure, Success, Try}
object Main extends Logging {
import scala.jdk.CollectionConverters._
object Main extends Logging {
val topology = new KafkaTopology
private val settings = new SettingsLoader(
......
......@@ -17,9 +17,9 @@
*
*/
package ch.memobase
package ch.memobase.rico2edm
import ch.memobase.ReportingObject.createTimestamp
import ch.memobase.rico2edm.ReportingObject.createTimestamp
import java.text.SimpleDateFormat
import java.util.Calendar
......
......@@ -18,10 +18,10 @@
*/
package ch.memobase.edm
package ch.memobase.rico2edm.edm
import ch.memobase.edm.subjects.{Aggregation, Concept, ModelXMLTransformer, Place, ProvidedCHO, TimeSpan, WebResource}
import ch.memobase.rico2edm.edm.subjects.{Aggregation, Concept, ModelXMLTransformer, Place, ProvidedCHO, TimeSpan, WebResource}
import java.time.format.DateTimeFormatter
import scala.collection.mutable
......
......@@ -18,9 +18,9 @@
*/
package ch.memobase.edm
package ch.memobase.rico2edm.edm
import ch.memobase.edm.subjects.ProvidedCHO
import ch.memobase.rico2edm.edm.subjects.ProvidedCHO
import org.eclipse.rdf4j.model.Model
import org.eclipse.rdf4j.model.util.ModelBuilder
import org.eclipse.rdf4j.rio.{RDFFormat, Rio}
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package ch.memobase.edm
package ch.memobase.rico2edm.edm
import ujson.Value.{Value => JValue}
import ujson.{Arr => JArr, Obj => JObj, Str => JStr}
......
......@@ -18,9 +18,9 @@
*/
package ch.memobase.edm.subjects
package ch.memobase.rico2edm.edm.subjects
import ch.memobase.rdf.writer.RdfXmlWriter
import ch.memobase.rico2edm.rdf.writer.RdfXmlWriter
import org.eclipse.rdf4j.model.Model
import org.eclipse.rdf4j.rio.Rio
import org.eclipse.rdf4j.rio.rdfxml.RDFXMLWriter
......
......@@ -18,10 +18,10 @@
*/
package ch.memobase.edm.subjects
package ch.memobase.rico2edm.edm.subjects
import ch.memobase.rdf.Helper
import ch.memobase.rdf.vocabularies.{EDMVocab, OreVocab}
import ch.memobase.rico2edm.rdf.Helper
import ch.memobase.rico2edm.rdf.vocabularies.{EDMVocab, OreVocab}
import org.eclipse.rdf4j.model.Model
import org.eclipse.rdf4j.model.impl.SimpleValueFactory
import org.eclipse.rdf4j.model.util.Values.iri
......
......@@ -18,7 +18,7 @@
*/
package ch.memobase.rdf
package ch.memobase.rico2edm.rdf
import org.eclipse.rdf4j.model.Model
import org.eclipse.rdf4j.model.util.ModelBuilder
......
......@@ -18,7 +18,7 @@
*/
package ch.memobase.rdf.vocabularies
package ch.memobase.rico2edm.rdf.vocabularies
import org.eclipse.rdf4j.model.IRI
import org.eclipse.rdf4j.model.impl.SimpleValueFactory
......
......@@ -22,7 +22,7 @@ package ch.memobase
import org.scalatest.matchers.should.Matchers
import org.scalatest.funsuite.AnyFunSuite
import Utils._
import KafkaTopologyUtils._
import ch.memobase.rico2edm.KafkaTopologyUtils._
class KafkaTopologyUtilsSpec extends AnyFunSuite with Matchers {
......
......@@ -17,11 +17,11 @@
*
*/
package ch.memobase.edm
package ch.memobase.rico2edm.edm
import ch.memobase.Utils.loadFile
import ch.memobase.edm.subjects.ProvidedCHO
import ch.memobase.rdf.writer.RdfXmlWriter
import ch.memobase.rico2edm.edm.subjects.ProvidedCHO
import ch.memobase.rico2edm.rdf.writer.RdfXmlWriter
import org.eclipse.rdf4j.rio.Rio
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
......
......@@ -18,11 +18,11 @@
*/
package ch.memobase.edm
package ch.memobase.rico2edm.edm
import ch.memobase.Utils.loadFile
import ch.memobase.edm.subjects.Aggregation
import ch.memobase.rdf.writer.RdfXmlWriter
import ch.memobase.rico2edm.edm.subjects.Aggregation
import ch.memobase.rico2edm.rdf.writer.RdfXmlWriter
import org.eclipse.rdf4j.rio.Rio
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
......
......@@ -18,11 +18,11 @@
*/
package ch.memobase.edm
package ch.memobase.rico2edm.edm
import ch.memobase.Utils.loadFile
import ch.memobase.edm.subjects.ProvidedCHO
import ch.memobase.rdf.writer.RdfXmlWriter
import ch.memobase.rico2edm.edm.subjects.ProvidedCHO
import ch.memobase.rico2edm.rdf.writer.RdfXmlWriter
import org.eclipse.rdf4j.rio.{RDFFormat, Rio}
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
......
......@@ -18,11 +18,11 @@
*/
package ch.memobase.edm
package ch.memobase.rico2edm.edm
import ch.memobase.Utils.loadFile
import ch.memobase.edm.subjects.{ProvidedCHO, WebResource}
import ch.memobase.rdf.writer.RdfXmlWriter
import ch.memobase.rico2edm.edm.subjects.{ProvidedCHO, WebResource}
import ch.memobase.rico2edm.rdf.writer.RdfXmlWriter
import org.eclipse.rdf4j.rio.Rio
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
......
......@@ -17,10 +17,10 @@
*
*/
package ch.memobase.edm
package ch.memobase.rico2edm.edm
import ch.memobase.Utils.loadFile
import ch.memobase.edm.subjects.{ProvidedCHO, WebResource}
import ch.memobase.rico2edm.edm.subjects.{ProvidedCHO, WebResource}
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment