sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1811173 - in /sis/data/non-free/sis-embedded-data: ./ src/main/java/org/apache/sis/resources/embedded/ src/main/resources/META-INF/ src/main/resources/META-INF/services/
Date Thu, 05 Oct 2017 09:07:39 GMT
Author: desruisseaux
Date: Thu Oct  5 09:07:38 2017
New Revision: 1811173

URL: http://svn.apache.org/viewvc?rev=1811173&view=rev
Log:
Create the database at build time and add license information in META-INF.

Added:
    sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/
    sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/LICENSE   (with props)
    sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/NOTICE   (with props)
    sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/services/
    sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/services/org.apache.sis.setup.InstallationResources
  (with props)
Modified:
    sis/data/non-free/sis-embedded-data/pom.xml
    sis/data/non-free/sis-embedded-data/src/main/java/org/apache/sis/resources/embedded/Generator.java

Modified: sis/data/non-free/sis-embedded-data/pom.xml
URL: http://svn.apache.org/viewvc/sis/data/non-free/sis-embedded-data/pom.xml?rev=1811173&r1=1811172&r2=1811173&view=diff
==============================================================================
--- sis/data/non-free/sis-embedded-data/pom.xml (original)
+++ sis/data/non-free/sis-embedded-data/pom.xml Thu Oct  5 09:07:38 2017
@@ -94,4 +94,51 @@ Provides non-free data, including the EP
       <artifactId>derby</artifactId>
     </dependency>
   </dependencies>
+
+  <!--
+    Launches the database generator program at build time, after compilation.
+    This program needs the 'sis-epsg' module to be checked out together with
+    this 'sis-embedded-data' module. The database will be created directly in
+    the 'target/classes' directory, and license files will be copied there.
+  -->
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <version>1.6.0</version>
+        <executions>
+          <execution>
+            <id>create-database</id>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>java</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <mainClass>org.apache.sis.resources.embedded.Generator</mainClass>
+          <cleanupDaemonThreads>false</cleanupDaemonThreads>
+          <systemProperties>
+            <property>
+              <key>derby.stream.error.file</key>
+              <value>${project.build.directory}/derby.log</value>
+            </property>
+          </systemProperties>
+        </configuration>
+      </plugin>
+
+      <!-- Exclude from the JAR file the classes used for generating the database. -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <include>**/Generator*</include>
+          </excludes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
 </project>

Modified: sis/data/non-free/sis-embedded-data/src/main/java/org/apache/sis/resources/embedded/Generator.java
URL: http://svn.apache.org/viewvc/sis/data/non-free/sis-embedded-data/src/main/java/org/apache/sis/resources/embedded/Generator.java?rev=1811173&r1=1811172&r2=1811173&view=diff
==============================================================================
--- sis/data/non-free/sis-embedded-data/src/main/java/org/apache/sis/resources/embedded/Generator.java
[UTF-8] (original)
+++ sis/data/non-free/sis-embedded-data/src/main/java/org/apache/sis/resources/embedded/Generator.java
[UTF-8] Thu Oct  5 09:07:38 2017
@@ -33,6 +33,7 @@ import org.opengis.util.FactoryException
 import org.opengis.referencing.crs.GeographicCRS;
 import org.apache.derby.jdbc.EmbeddedDataSource;
 import org.apache.sis.internal.metadata.sql.Initializer;
+import org.apache.sis.internal.system.Shutdown;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.metadata.MetadataStandard;
 import org.apache.sis.metadata.sql.MetadataSource;
@@ -77,6 +78,7 @@ final class Generator {
         gen.createMetadata();
         gen.createEPSG();
         gen.shutdown();
+        Shutdown.stop(Generator.class);
     }
 
     /**
@@ -197,6 +199,8 @@ final class Generator {
 
     /**
      * Copies the EPSG terms of use from the {@code sis-epsg} module to this {@code sis-embedded-data}
module.
+     * We copy those files ourselves instead than relying on {@code maven-resources-plugin}
because a future
+     * version may combine more licenses in a single file.
      */
     private void copyLicenseFiles() throws IOException {
         Files.copy(sourceEPSG.resolve("LICENSE.txt"),  licenseTarget.resolve("LICENSE.txt"));

Added: sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/LICENSE
URL: http://svn.apache.org/viewvc/sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/LICENSE?rev=1811173&view=auto
==============================================================================
--- sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/LICENSE (added)
+++ sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/LICENSE Thu Oct  5 09:07:38
2017
@@ -0,0 +1 @@
+link ../../../../../sis-epsg/src/main/resources/META-INF/LICENSE
\ No newline at end of file

Propchange: sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/LICENSE
------------------------------------------------------------------------------
    svn:special = *

Added: sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/NOTICE
URL: http://svn.apache.org/viewvc/sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/NOTICE?rev=1811173&view=auto
==============================================================================
--- sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/NOTICE (added)
+++ sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/NOTICE Thu Oct  5 09:07:38
2017
@@ -0,0 +1 @@
+link ../../../../../sis-epsg/src/main/resources/META-INF/NOTICE
\ No newline at end of file

Propchange: sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/NOTICE
------------------------------------------------------------------------------
    svn:special = *

Added: sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/services/org.apache.sis.setup.InstallationResources
URL: http://svn.apache.org/viewvc/sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/services/org.apache.sis.setup.InstallationResources?rev=1811173&view=auto
==============================================================================
--- sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/services/org.apache.sis.setup.InstallationResources
(added)
+++ sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/services/org.apache.sis.setup.InstallationResources
[UTF-8] Thu Oct  5 09:07:38 2017
@@ -0,0 +1 @@
+org.apache.sis.resources.embedded.EmbeddedResources

Propchange: sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/services/org.apache.sis.setup.InstallationResources
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/data/non-free/sis-embedded-data/src/main/resources/META-INF/services/org.apache.sis.setup.InstallationResources
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8



Mime
View raw message