diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 0e3eb3ec37e25901c2ddd4407813aef087cd3780..7ec491698a6e134ade2ff19ca1a76429a0390335 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -9,11 +9,11 @@ <module name="rdf" /> <module name="unl-parser" /> </profile> - <profile name="Annotation profile for unl2rdf" enabled="true"> + <profile name="Annotation profile for unlTools" enabled="true"> <sourceOutputDir name="target/generated-sources/annotations" /> <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> <outputRelativeToContentRoot value="true" /> - <option name="project" value="unl2rdf/unl2rdf-app" /> + <option name="project" value="fr.tetras_libre.unl/unl2rdf-app" /> <processorPath useClasspath="false"> <entry name="$MAVEN_REPOSITORY$/info/picocli/picocli-codegen/4.2.0/picocli-codegen-4.2.0.jar" /> <entry name="$MAVEN_REPOSITORY$/info/picocli/picocli/4.2.0/picocli-4.2.0.jar" /> @@ -32,7 +32,7 @@ <option name="ADDITIONAL_OPTIONS_OVERRIDE"> <module name="unl-parser" options="" /> <module name="unl2rdf" options="-Aproject=unl2rdf/unl2rdf" /> - <module name="unl2rdf-app" options="-Aproject=unl2rdf/unl2rdf-app" /> + <module name="unl2rdf-app" options="-Aproject=fr.tetras_libre.unl/unl2rdf-app" /> </option> </component> </project> \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml index 712ab9d985c20018a0c97b93d2148ac1ffe588a5..c87e8c500e9c1df3b5948f5b8df266ba8206ed75 100644 --- a/.idea/jarRepositories.xml +++ b/.idea/jarRepositories.xml @@ -1,6 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="RemoteRepositoriesConfiguration"> + <remote-repository> + <option name="id" value="tetra_central" /> + <option name="name" value="Tetras Central" /> + <option name="url" value="file:////Users/scurt/.m2/tetrasArtifacts-unl" /> + </remote-repository> <remote-repository> <option name="id" value="central" /> <option name="name" value="Central Repository" /> @@ -11,6 +16,11 @@ <option name="name" value="Maven Central repository" /> <option name="url" value="https://repo1.maven.org/maven2" /> </remote-repository> + <remote-repository> + <option name="id" value="tetra_central" /> + <option name="name" value="Tetras Central" /> + <option name="url" value="file:////Users/scurt/.m2/tetrasArtifacts/repository" /> + </remote-repository> <remote-repository> <option name="id" value="jboss.community" /> <option name="name" value="JBoss Community repository" /> diff --git a/README.md b/README.md index 727e706a2775b1ce9f475e3a845fb15ab348be6c..e35073dd1aa2f10bb7edee086889e4f5153b062b 100644 --- a/README.md +++ b/README.md @@ -5,32 +5,51 @@ A serialization converter from the official UNL format to the proposed RDF-UNL f UnlTools program requires rdf-vocabulary package within tetras-libre repositories. Three solutions exists add the other dependency, choose your preferred way. -## Use of script createOrUpdateLocalMavenRepository. +## Requirements +- Maven 3+ +- Git +- Java jdk 11+ + +### Unix base system check list + +- The `mvn --version` notice java version 11+ + +Example of valid output: ```shell script -git clone https://gitlab.tetras-libre.fr/unl/unl2rdf.git unlTools -cd unlTools -bash Scripts/createOrUpdateLocalMavenRepository.sh -mvn compile +$ mvn --version +Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) +Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec +Java version: 13.0.2, vendor: N/A, runtime: /usr/local/Cellar/openjdk/13.0.2+8_2/libexec/openjdk.jdk/Contents/Home +Default locale: en_FR, platform encoding: UTF-8 +OS name: "mac os x", version: "10.15.3", arch: "x86_64", family: "mac" ``` -## Clone repository rdf-vocabulary. +if java version is lower to 11 follow instructions [maven.apache.org/intall](https://maven.apache.org/install.html) + +### Windows check list + +- The `JAVA_HOME` system environment variable is configured +- The `MAVEN_HOME` system environment variable is configured +- The `PATH` system environment variable contains path to `%JAVA_HOME%/bin` and also `%MAVEN_HOME%/bin` directories +- The `PATH` system environment variable contains path to git binary executable + +## Use of script createOrUpdateLocalTetrasArtifactsRepository. + +The script `createOrUpdateLocalMavenRepository` + +- Linux platform ```shell script -git clone https://gitlab.tetras-libre.fr/unl/rdfunl.git rdf-vocabulary -pushd rdf-vocabulary -cd rdf-vocabulary -mvn install -popd -git clone https://gitlab.tetras-libre.fr/unl/unl2rdf.git unlTools -cd unlTools +git clone https://gitlab.tetras-libre.fr/unl/unlTools.git unlTools +pushd unlTools +sh Scripts/createOrUpdateLocalMavenRepository.sh mvn compile +popd ``` -## Install manually rdf-vocabulary. - +- Windows plateform ```shell script -git clone https://gitlab.tetras-libre.fr/unl/rdfunl.git rdf-vocabulary -cd unlTools -mvn install:install-file -Dfile=./rdf/libs/rdf-vocabulary-1.0-SNAPSHOT.jar -DgroupId=fr.tetras_libre.rdf.vocabulary -DartifactId=rdf-vocabulary -Dversion=1.0-SNAPSHOT -Dpackaging=jar -DgeneratePom=true + ``` + diff --git a/Scripts/createOrUpdateLocalMavenRepository.sh b/Scripts/createOrUpdateLocalMavenRepository.sh deleted file mode 100644 index 7b3159b8edfe93d91a3019f91a31a540d1c8650b..0000000000000000000000000000000000000000 --- a/Scripts/createOrUpdateLocalMavenRepository.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -tempDir=temp-rdf-vocabulary - -git clone https://gitlab.tetras-libre.fr/unl/rdfunl.git temp-rdf-vocabulary -pushd "${tempDir}" -mvn install -popd -rm -rf "${tempDir}" \ No newline at end of file diff --git a/Scripts/createOrUpdateLocalTetrasArtifactsRepository.bat b/Scripts/createOrUpdateLocalTetrasArtifactsRepository.bat new file mode 100644 index 0000000000000000000000000000000000000000..700e54f43fef9c4e0a9d7c38deafa2ca62864800 --- /dev/null +++ b/Scripts/createOrUpdateLocalTetrasArtifactsRepository.bat @@ -0,0 +1,12 @@ +@ECHO OFF + +IF EXIST "%HOMEDRIVE%%HOMEPATH%\.m2\tetrasArtifacts-unl\" ( + ECHO "Local tetras artifacts repository exist -> updating" + PUSHD "%HOMEDRIVE%%HOMEPATH%\.m2\tetrasArtifacts-unl\" && git pull && ECHO "Local tetras artifacts update: done" && POPD && EXIT 0 + ECHO "An error occured during local tetras artifacts update (exit status: %ERRORLEVEL%)" + POPD +) ELSE ( + ECHO "Local tetras artifacts repository doesn't exist -> creating" + git clone https://gitlab.tetras-libre.fr/unl/unl-artifacts-test.git "%HOMEDRIVE%%HOMEPATH%\.m2\tetrasArtifacts-unl" && ECHO "local tetras artifacts creation: done" && POPD && EXIT 0 + ECHO "An error occured during local tetras artifacts creation (exit status: %ERRORLEVEL%)" +) \ No newline at end of file diff --git a/Scripts/createOrUpdateLocalTetrasArtifactsRepository.sh b/Scripts/createOrUpdateLocalTetrasArtifactsRepository.sh new file mode 100644 index 0000000000000000000000000000000000000000..d0412af6475b32cd7e87a571d4833ad909661109 --- /dev/null +++ b/Scripts/createOrUpdateLocalTetrasArtifactsRepository.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +tempDir=temp-rdf-vocabulary + +if [ -d ~/.m2/tetrasArtifacts-unl ] +then + echo "Local tetras artifacts repository exist -> updating" + pushd ~/.m2/tetrasArtifacts-unl/ && git pull && echo "Local tetras artifacts update: done" && exit 0 + echo "An error occured during local tetras artifacts update (exit status: $?)" + popd +else + echo "Local tetras artifacts repository doesn't exist -> creating" + git clone https://gitlab.tetras-libre.fr/unl/unl-artifacts-test.git ~/.m2/tetrasArtifacts-unl && echo "local tetras artifacts creation: done" && exit 0 + echo "An error occured during local tetras artifacts update (exit status: %?)" +fi diff --git a/pom.xml b/pom.xml index a220588de214e24927631e7655aeb1a0194bc44e..e68c2c6d56e034d77f849547f185411052d74088 100644 --- a/pom.xml +++ b/pom.xml @@ -4,8 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> - <groupId>unl2rdf</groupId> - <artifactId>unl2rdf</artifactId> + <groupId>fr.tetras_libre.unl</groupId> + <artifactId>unlTools</artifactId> <version>1.0-SNAPSHOT</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> @@ -95,6 +95,23 @@ <scope>test</scope> </dependency> </dependencies> - + <repositories> + <repository> + <snapshots> + <enabled>false</enabled> + </snapshots> + <id>central</id> + <name>Central Repository</name> + <url>https://repo.maven.apache.org/maven2</url> + </repository> + <repository> + <snapshots> + <enabled>true</enabled> + </snapshots> + <id>tetra_central</id> + <name>Tetras Central</name> + <url>file:///${user.home}/.m2/tetrasArtifacts-unl</url> + </repository> + </repositories> </project> diff --git a/rdf/pom.xml b/rdf/pom.xml index bb954f4195329dc96b6cfa8795fb241b4fcf4b19..5f2225f9a4bd1eed0e2180a1c31686e8ff63cf3e 100644 --- a/rdf/pom.xml +++ b/rdf/pom.xml @@ -2,22 +2,20 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> - <artifactId>unl2rdf</artifactId> - <groupId>unl2rdf</groupId> + <groupId>fr.tetras_libre.unl</groupId> + <artifactId>unlTools</artifactId> <version>1.0-SNAPSHOT</version> </parent> - <modelVersion>4.0.0</modelVersion> + <name>rdf2Unl</name> <artifactId>rdf</artifactId> <packaging>jar</packaging> - <build> - <finalName>rdf2Unl-${project.version}.jar</finalName> - </build> - <dependencies> <dependency> <groupId>org.apache.jena</groupId> @@ -26,15 +24,23 @@ <version>3.14.0</version> </dependency> <dependency> - <groupId>unl2rdf</groupId> + <groupId>fr.tetras_libre.unl</groupId> <artifactId>unl-parser</artifactId> <version>1.0-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> - <groupId>fr.tetras_libre.rdf.vocabulary</groupId> - <artifactId>rdf-vocabulary</artifactId> + <groupId>fr.tetras_libre.rdf</groupId> + <artifactId>rdf-unl-java-vocabulary</artifactId> <version>1.0-SNAPSHOT</version> </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-nop</artifactId> + <version>1.7.30</version> + <scope>test</scope> + </dependency> </dependencies> + + </project> \ No newline at end of file diff --git a/rdf/rdf.iml b/rdf/rdf.iml index 269d29d178928fe6e14d1763694b9cb5d3dd4600..deff3312d1d1ac24100482078914fcd3a8045f3e 100644 --- a/rdf/rdf.iml +++ b/rdf/rdf.iml @@ -45,7 +45,8 @@ <orderEntry type="library" name="Maven: org.apache.jena:jena-rdfconnection:3.14.0" level="project" /> <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" /> <orderEntry type="module" module-name="unl-parser" /> - <orderEntry type="library" name="Maven: fr.tetras_libre.rdf.vocabulary:rdf-vocabulary:1.0-SNAPSHOT" level="project" /> + <orderEntry type="library" name="Maven: fr.tetras_libre.rdf:rdf-unl-java-vocabulary:1.0-SNAPSHOT" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.slf4j:slf4j-nop:1.7.30" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.7.0-M1" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.7.0-M1" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" /> diff --git a/unl-parser/pom.xml b/unl-parser/pom.xml index 70a3629a34feec171882f3b007fcaaee5ab5fe99..1ab77b913090ab018cc1f5b2212ea422eeb40049 100644 --- a/unl-parser/pom.xml +++ b/unl-parser/pom.xml @@ -5,9 +5,9 @@ <modelVersion>4.0.0</modelVersion> <parent> - <groupId>unl2rdf</groupId> + <groupId>fr.tetras_libre.unl</groupId> + <artifactId>unlTools</artifactId> <version>1.0-SNAPSHOT</version> - <artifactId>unl2rdf</artifactId> </parent> <artifactId>unl-parser</artifactId> diff --git a/unl2rdf-app/pom.xml b/unl2rdf-app/pom.xml index 4b63d5b2eae90ffd6a07b5849be643a9ff86a084..2c661efcf95d2a9336980a5f51b20df0a0937582 100644 --- a/unl2rdf-app/pom.xml +++ b/unl2rdf-app/pom.xml @@ -5,12 +5,12 @@ <modelVersion>4.0.0</modelVersion> <parent> - <groupId>unl2rdf</groupId> + <groupId>fr.tetras_libre.unl</groupId> + <artifactId>unlTools</artifactId> <version>1.0-SNAPSHOT</version> - <artifactId>unl2rdf</artifactId> </parent> - <name>Main</name> + <name>main-App</name> <artifactId>unl2rdf-app</artifactId> <packaging>jar</packaging> @@ -22,8 +22,7 @@ <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> - <source>11</source> - <target>11</target> + <release>11</release> <annotationProcessorPaths> <path> <groupId>info.picocli</groupId> @@ -44,58 +43,49 @@ <archive> <manifest> <addClasspath>true</addClasspath> - <mainClass>unl2rdf.Unl2Rdf</mainClass> <classpathPrefix>lib/</classpathPrefix> + <classpathLayoutType>repository</classpathLayoutType> + <mainClass>unl2rdf.Unl2Rdf</mainClass> </manifest> - <manifestEntries> - <Class-Path>.</Class-Path> - </manifestEntries> </archive> </configuration> </plugin> - <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <version>3.1.2</version> + <artifactId>maven-shade-plugin</artifactId> + <version>3.2.3</version> <executions> <execution> - <id>copy-dependencies</id> <phase>package</phase> <goals> - <goal>copy-dependencies</goal> + <goal>shade</goal> </goals> <configuration> - <outputDirectory> - ${project.build.directory}/lib/ - </outputDirectory> - <overWriteIfNewer>true</overWriteIfNewer> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-assembly-plugin</artifactId> - <version>3.3.0</version> - <executions> - <execution> - <id>create-my-bundle</id> - <phase>package</phase> - <goals> - <goal>single</goal> - </goals> - <configuration> - <descriptorRefs> - <descriptorRef>jar-with-dependencies</descriptorRef> - </descriptorRefs> - <archive> - <manifest> - <addClasspath>true</addClasspath> - <mainClass>unl2rdf.Unl2Rdf</mainClass> - </manifest> - </archive> + <artifactSet> + <excludes> + <exclude>junit:junit</exclude> + </excludes> + </artifactSet> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <ManifestEntries> + <mainClass>unl2rdf.Unl2Rdf</mainClass> + <Build-Number>1</Build-Number> + </ManifestEntries> + </transformer> + <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"> + </transformer> + </transformers> + <relocations> + <relocation> + <pattern>org.apache.jena</pattern> + <shadedPattern>org.shade.jena</shadedPattern> + </relocation> + <relocation> + <pattern>org.apache.jena.sys.JenaSubsystemLifecycle</pattern> + <shadedPattern>org.shaded.jena.sys.JenaSubsystemLifecycle</shadedPattern> + </relocation> + </relocations> </configuration> </execution> </executions> @@ -110,16 +100,22 @@ <version>4.2.0</version> </dependency> <dependency> - <groupId>unl2rdf</groupId> + <groupId>fr.tetras_libre.unl</groupId> <artifactId>unl-parser</artifactId> <version>${project.version}</version> </dependency> <dependency> - <groupId>unl2rdf</groupId> + <groupId>fr.tetras_libre.unl</groupId> <artifactId>rdf</artifactId> - <version>${project.version}</version> + <version>1.0-SNAPSHOT</version> <scope>compile</scope> </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-nop</artifactId> + <version>1.7.30</version> + <scope>test</scope> + </dependency> </dependencies> diff --git a/unl2rdf-app/unl2rdf-app.iml b/unl2rdf-app/unl2rdf-app.iml index eed8dc0bf76e218089f4fb87382b16b01c2a456b..c5db61aa0cd61f6a435dc39407fb48d8dfb6224a 100644 --- a/unl2rdf-app/unl2rdf-app.iml +++ b/unl2rdf-app/unl2rdf-app.iml @@ -46,8 +46,9 @@ <orderEntry type="library" name="Maven: org.apache.jena:jena-dboe-base:3.14.0" level="project" /> <orderEntry type="library" name="Maven: org.apache.jena:jena-dboe-index:3.14.0" level="project" /> <orderEntry type="library" name="Maven: org.apache.jena:jena-rdfconnection:3.14.0" level="project" /> - <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" /> - <orderEntry type="library" name="Maven: fr.tetras_libre.rdf.vocabulary:rdf-vocabulary:1.0-SNAPSHOT" level="project" /> + <orderEntry type="library" name="Maven: fr.tetras_libre.rdf:rdf-unl-java-vocabulary:1.0-SNAPSHOT" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.slf4j:slf4j-nop:1.7.30" level="project" /> + <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.7.0-M1" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.7.0-M1" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />