Skip to content

Commit

Permalink
#215 - Use wagon-maven-plugin for Ontology Download
Browse files Browse the repository at this point in the history
- use wagon-maven-plugin for the download part of the ontology download/unpack process
  • Loading branch information
michael-82 committed Oct 27, 2023
1 parent db819c9 commit e941b48
Showing 1 changed file with 38 additions and 32 deletions.
70 changes: 38 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@

<build>
<finalName>feasibilityBackend</finalName>

<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -381,6 +380,9 @@
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<downloadDirectory.base>ontology/</downloadDirectory.base>
</properties>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -416,42 +418,49 @@
</arguments>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>2.0.2</version>
<executions>
<execution>
<id>create-ontology-subdirectories</id>
<id>download-ontology</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
<goal>download-single</goal>
</goals>
<configuration>
<executable>mkdir</executable>
<arguments>
<argument>ontology/migration</argument>
<argument>ontology/ui_trees</argument>
</arguments>
<url>https://github.com/medizininformatik-initiative/fhir-ontology-generator/raw/${ontology-tag}/example/mii_core_data_set/ontology</url>
<fromFile>backend.zip</fromFile>
<toDir>${downloadDirectory.base}</toDir>
</configuration>
</execution>

<execution>
<id>download-ontology-backend</id>
<id>download-mapping</id>
<phase>generate-resources</phase>
<goals>
<goal>exec</goal>
<goal>download-single</goal>
</goals>
<configuration>
<executable>curl</executable>
<arguments>
<argument>-L</argument>
<argument>https://github.com/medizininformatik-initiative/fhir-ontology-generator/raw/${ontology-tag}/example/mii_core_data_set/ontology/backend.zip</argument>
<argument>-o</argument>
<argument>ontology/backend.zip</argument>
</arguments>
<url>https://github.com/medizininformatik-initiative/fhir-ontology-generator/raw/${ontology-tag}/example/mii_core_data_set/ontology</url>
<fromFile>mapping.zip</fromFile>
<toDir>${downloadDirectory.base}</toDir>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>unpack-ontology-backend</id>
<phase>generate-resources</phase>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
Expand All @@ -466,40 +475,37 @@
</execution>

<execution>
<id>move-db-script</id>
<phase>generate-resources</phase>
<id>create-ontology-subdirectory</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mv</executable>
<executable>mkdir</executable>
<arguments>
<argument>ontology/ui_trees/R__Load_latest_ui_profile.sql</argument>
<argument>ontology/migration/</argument>
</arguments>
</configuration>
</execution>

<execution>
<id>download-ontology-mapping</id>
<phase>generate-resources</phase>
<id>move-db-script</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>curl</executable>
<executable>mv</executable>
<arguments>
<argument>-L</argument>
<argument>https://github.com/medizininformatik-initiative/fhir-ontology-generator/raw/${ontology-tag}/example/mii_core_data_set/ontology/mapping.zip</argument>
<argument>-o</argument>
<argument>ontology/mapping.zip</argument>
<argument>ontology/ui_trees/R__Load_latest_ui_profile.sql</argument>
<argument>ontology/migration/</argument>
</arguments>
</configuration>
</execution>

<execution>
<id>unpack-ontology-mapping</id>
<phase>generate-resources</phase>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
Expand All @@ -515,7 +521,7 @@

<execution>
<id>delete-zip-files</id>
<phase>generate-resources</phase>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
Expand Down

0 comments on commit e941b48

Please sign in to comment.