diff --git a/build.gradle b/build.gradle index fee9d2d9..1d91af04 100644 --- a/build.gradle +++ b/build.gradle @@ -46,6 +46,7 @@ allprojects { versionWildfly = '31.0.1.Final' versionHibernate = '6.4.4.Final' versionHibernateSearch = '7.0.0.Final' + versionLucene = '9.8.0' // other frameworks and libraries versionMapDB = '3.1.0' versionCommonsNet = '3.5' diff --git a/service-ejb/build.gradle b/service-ejb/build.gradle deleted file mode 100644 index 79a61eee..00000000 --- a/service-ejb/build.gradle +++ /dev/null @@ -1,87 +0,0 @@ -description = 'MoWeSta Service Ejb' - -configurations { - testBundle - testBundle.transitive = true -} - - -dependencies { - api project(':service-api') - api project(':service-data') - - api "org.mapstruct:mapstruct-jdk8:${mapstructVersion}" - api "org.infinispan:infinispan-query:${versionInfinispan}" - api "com.locoslab.library.geometry:geometry-wgs:${versionGeometry}" - api "com.locoslab.service.carta:carta-api:${versionCarta}" - api "org.jboss.resteasy:resteasy-client:${versionResteasy}" - api "org.jboss.resteasy:resteasy-jackson2-provider:${versionResteasy}" - - compileOnly "com.fasterxml.jackson.core:jackson-databind:${versionJackson}" - - compileOnly "org.hibernate.search:hibernate-search-mapper-orm-jakarta:${versionHibernateSearch}" - compileOnly "jakarta.platform:jakarta.jakartaee-api:${versionJavaee}" - compileOnly "com.fasterxml.jackson.core:jackson-annotations:${versionJackson}" - compileOnly "org.mapstruct:mapstruct-processor:${mapstructVersion}" - - testImplementation "org.infinispan:infinispan-core:${versionInfinispan}" - testImplementation "org.infinispan:infinispan-commons:${versionInfinispan}" - testImplementation "org.infinispan:infinispan-query:${versionInfinispan}" - testImplementation "org.hibernate.search:hibernate-search-mapper-orm-jakarta:${versionHibernateSearch}" - testImplementation "jakarta.platform:jakarta.jakartaee-api:${versionJavaee}" - - testImplementation "jakarta.xml.bind:jakarta.xml.bind-api:${versionJaxb}" - testImplementation "com.fasterxml.jackson.core:jackson-databind:${versionJackson}" - testImplementation "junit:junit:${versionJunit}" - testImplementation "org.jboss.arquillian.junit:arquillian-junit-container:${versionArquillianJunit}" - testImplementation "org.wildfly.arquillian:wildfly-arquillian-container-managed:${versionArquillianContainer}" - - annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}" - - testBundle "org.infinispan:infinispan-query:${versionInfinispan}" - testBundle "com.locoslab.library.geometry:geometry-wgs:${versionGeometry}" - testBundle "com.locoslab.service.carta:carta-api:${versionCarta}" - testBundle "org.jboss.resteasy:resteasy-client:${versionResteasy}" - testBundle "org.jboss.resteasy:resteasy-jackson2-provider:${versionResteasy}" - -} - -// copy the jars required for testing into an output folder -task copyTestLibraries(type: Copy) { - into "$buildDir/test-libraries" - from configurations.testBundle -} -// make testing depend on the presence of the libraries -test.dependsOn("copyTestLibraries") - - -// depend on wildfly task for testing -test.dependsOn(project(":service-wildfly").tasks["build"]) - -jar { - manifest { - attributes( - 'Built-By' : System.properties['user.name'], - 'Build-Timestamp': new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()), - 'Created-By' : "Gradle ${gradle.gradleVersion}", - 'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})", - 'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}", - 'Implementation-Build' : "${System.properties['jenkins.build.number']}", - 'Dependencies': 'jdk.unsupported', - 'Implementation-Version' : project.version, - ) - } -} - -sourceSets { - main { - java { - srcDir "${buildDir.absolutePath}/generated/sources/annotationProcessor/java/main" - } - } -} - -compileJava { - options.annotationProcessorPath = configurations.annotationProcessor -} - diff --git a/service-ejb/src/main/resources/META-INF/jboss-ejb3.xml b/service-ejb/src/main/resources/META-INF/jboss-ejb3.xml deleted file mode 100644 index b0b022a8..00000000 --- a/service-ejb/src/main/resources/META-INF/jboss-ejb3.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - * - jaspitest - - - \ No newline at end of file diff --git a/service-ejb/src/test/resources/META-INF/beans.xml b/service-ejb/src/test/resources/META-INF/beans.xml deleted file mode 100644 index a46d52e5..00000000 --- a/service-ejb/src/test/resources/META-INF/beans.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - com.mowesta.service.session.test.DataTestBean - com.mowesta.service.session.test.InfinispanTestBean - com.mowesta.service.session.test.EmailTestBean - com.mowesta.service.session.test.LocationSyncTestBean - com.mowesta.service.session.test.PeriodicSyncTestBean - com.mowesta.service.session.test.WeatherReportSyncTestBean - - - - - test - diff --git a/service-ejb/src/test/resources/META-INF/persistence.xml b/service-ejb/src/test/resources/META-INF/persistence.xml deleted file mode 100644 index 75ae382a..00000000 --- a/service-ejb/src/test/resources/META-INF/persistence.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - java:jboss/datasources/ExampleDS - - - - - - - - - - diff --git a/service-ejb/src/test/resources/arquillian.xml b/service-ejb/src/test/resources/arquillian.xml deleted file mode 100644 index 236151cc..00000000 --- a/service-ejb/src/test/resources/arquillian.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - 10990 - - - -Djboss.socket.binding.port-offset=1000 - - ../service-wildfly/wildfly-21.0.0.Final - - ../../../../service-ejb/src/test/resources/wildfly.xml - - - - diff --git a/service-ejb/src/test/resources/wildfly.xml b/service-ejb/src/test/resources/wildfly.xml deleted file mode 100644 index a6190cf4..00000000 --- a/service-ejb/src/test/resources/wildfly.xml +++ /dev/null @@ -1,541 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE - h2 - - sa - sa - - - - - org.h2.jdbcx.JdbcDataSource - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${jboss.bind.address:127.0.0.1} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/service-jpa/build.gradle b/service-jpa/build.gradle deleted file mode 100644 index 8fe45b68..00000000 --- a/service-jpa/build.gradle +++ /dev/null @@ -1,21 +0,0 @@ -description = 'MoWeSta Service Jpa' - -dependencies { - compileOnly "org.hibernate.orm:hibernate-core:${versionHibernate}" -} - -jar { - manifest { - attributes( - 'Built-By' : System.properties['user.name'], - 'Build-Timestamp': new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()), - 'Created-By' : "Gradle ${gradle.gradleVersion}", - 'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})", - 'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}", - 'Implementation-Build' : "${System.properties['jenkins.build.number']}", - 'Dependencies': 'org.hibernate', - 'Implementation-Version' : project.version, - ) - } -} - diff --git a/service-jpa/src/main/java/com/mowesta/service/injection/PersistenceProvider.java b/service-jpa/src/main/java/com/mowesta/service/injection/PersistenceProvider.java deleted file mode 100644 index e0ebd8d7..00000000 --- a/service-jpa/src/main/java/com/mowesta/service/injection/PersistenceProvider.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.mowesta.service.injection; - -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.naming.InitialContext; -import javax.naming.NamingException; -import jakarta.persistence.EntityManagerFactory; -import jakarta.persistence.spi.PersistenceUnitInfo; - -import org.hibernate.jpa.HibernatePersistenceProvider; - -/** - * This class implements a wrapper around the hibernate persistence provider - * that automatically sets the hibernate search file index base using an - * entry in the naming service of the container. Note that this functionality - * cannot be implemented at a higher level of abstraction since hibernate search - * will initialize itself as soon as the entity manager factory is created. - * This means that we actually need to replace the provider to ensure that - * the property is set at an early stage during the application startup. - * - * @author Marcus - */ -public class PersistenceProvider extends HibernatePersistenceProvider { - - /** - * The hibernate search property to set the index base. - */ - private static final String KEY_LUCENE = "hibernate.search.backend.directory.root"; - - /** - * The name entry used to find the configuration of the lucene folder. - */ - private static final String NAME_LUCENE = "java:global/mowesta/folderLucene"; - - /** - * The default value for the configuration of the lucene folder. - */ - private static final String VALUE_LUCENE = "/var/lucene/mowesta"; - - /** - * The logger to generate debug output. - */ - private Logger logger = Logger.getLogger(getClass().getName()); - - @Override - @SuppressWarnings({ "rawtypes", "unchecked" }) - public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties) { - logger.log(Level.INFO, "Creating entity manager factory."); - if (! properties.containsKey(KEY_LUCENE)) { - properties.put(KEY_LUCENE, getLuceneFolder()); - } - logger.log(Level.INFO, "Setting lucene folder to: " + properties.get(KEY_LUCENE)); - return super.createContainerEntityManagerFactory(info, properties); - } - - /** - * Returns the lucene folder from the name service - * or the default value, if the name is not bound. - * - * @return The lucene folder used as index base. - */ - private String getLuceneFolder() { - try { - InitialContext ctx = new InitialContext(); - Object v = ctx.lookup(NAME_LUCENE); - if (v instanceof String) { - return (String)v; - } - } catch (NamingException e) { - // ignore unbound value - } - return VALUE_LUCENE; - } - -} diff --git a/service-war/build.gradle b/service-war/build.gradle index ad72ccc6..fff2f202 100644 --- a/service-war/build.gradle +++ b/service-war/build.gradle @@ -13,7 +13,6 @@ configurations { dependencies { implementation project(':service-api') implementation project(':service-data') - implementation project(':service-jpa') implementation "org.mapstruct:mapstruct:${mapstructVersion}" implementation "com.locoslab.library.geometry:geometry-wgs:${versionGeometry}" @@ -53,6 +52,7 @@ dependencies { testImplementation "org.jboss.arquillian.protocol:arquillian-protocol-servlet-jakarta:${versionArquillianProtocol}" testImplementation "org.jboss.resteasy:resteasy-client:${versionResteasy}" testImplementation "org.hibernate.orm:hibernate-core:${versionHibernate}" + testImplementation "org.apache.lucene:lucene-queryparser:${versionLucene}" testBundle "com.locoslab.library.geometry:geometry-wgs:${versionGeometry}" testBundle "com.locoslab.service.carta:carta-api:${versionCarta}" diff --git a/service-ejb/src/test/sql/prepare_test_database.sql b/service-war/src/test/sql/prepare_test_database.sql similarity index 100% rename from service-ejb/src/test/sql/prepare_test_database.sql rename to service-war/src/test/sql/prepare_test_database.sql diff --git a/settings.gradle b/settings.gradle index f316287f..aeb66042 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,10 +7,8 @@ include(':ios-app') include(':service-api') include(':service-wildfly') include(':service-data') -include(':service-jpa') include(':service-tool') include(':service-war') include(':web-angular') include(':web-war') -include(':site-ear') include(':tool-export') diff --git a/site-ear/build.gradle b/site-ear/build.gradle deleted file mode 100644 index 34ec3b84..00000000 --- a/site-ear/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -import java.text.SimpleDateFormat - -plugins { - id 'ear' -} - -description = 'MoWeSta Site Ear' - -dependencies { - earlib project(':service-jpa') - deploy project(path: ':service-war', configuration: 'archives') - deploy project(path: ':web-war', configuration: 'archives') -} - -ear { - appDirName 'src/main/app' - libDirName 'libs' - deploymentDescriptor { - version = "7" - applicationName = "mowesta" - initializeInOrder = true - displayName = "mowesta" - webModule("service-war-${project.version}.war", "api") - webModule("web-war-${project.version}.war", "app") - } - manifest { - attributes( - 'Built-By' : System.properties['user.name'], - 'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()), - 'Created-By' : "Gradle ${gradle.gradleVersion}", - 'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})", - 'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}" - ) - } -} diff --git a/wiki-images/Datenmodell.png b/wiki-images/Datenmodell.png deleted file mode 100644 index 4e09d5e8..00000000 Binary files a/wiki-images/Datenmodell.png and /dev/null differ