Skip to content

Commit

Permalink
fixes for library conflicts in export
Browse files Browse the repository at this point in the history
  • Loading branch information
moovida committed Feb 25, 2017
1 parent 28277cf commit b138025
Show file tree
Hide file tree
Showing 12 changed files with 335 additions and 283 deletions.
2 changes: 2 additions & 0 deletions org.jgrasstools.gvsig/mvninstall.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
cp gvsig-devel.properties ~/.gvsig-devel.properties
mvn install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Danimal.sniffer.skip=true -Dsource.skip=true

cp ~/.m2/repository/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar ~/SOFTWARE/GVSIG/LATEST/gvSIG/extensiones/org.jgrasstools.gvsig.base/lib/
28 changes: 26 additions & 2 deletions org.jgrasstools.gvsig/org.jgrasstools.gvsig.base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
<version>0.1.0</version>
</parent>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jfree</groupId>
<artifactId>jcommon</artifactId>
Expand All @@ -33,15 +45,21 @@
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.tools.lib</artifactId>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>jfree</groupId>
<artifactId>jcommon</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.andami</artifactId>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
<groupId>jfree</groupId>
<artifactId>jcommon</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand Down Expand Up @@ -75,6 +93,10 @@
<groupId>org.geotools</groupId>
<artifactId>gt2-coverage</artifactId>
</exclusion>
<exclusion>
<groupId>jfree</groupId>
<artifactId>jcommon</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand All @@ -86,6 +108,8 @@
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
<scope>compile</scope>
<exclusions>
</exclusions>
</dependency>
<dependency>
<groupId>org.gvsig</groupId>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- <depends plugin-name="org.gvsig.app.mainplugin" /> -->
<depends plugin-name="org.gvsig.raster.mainplugin" />
<depends plugin-name="org.gvsig.raster.tools.app.basic" />
<depends plugin-name="org.gvsig.view3d.app" />
<libraries library-dir="lib" />

<resourceBundle name="text" />
Expand Down
12 changes: 12 additions & 0 deletions org.jgrasstools.gvsig/org.jgrasstools.gvsig.epanet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
<version>0.1.0</version>
</parent>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.tools.lib</artifactId>
Expand Down
98 changes: 62 additions & 36 deletions org.jgrasstools.gvsig/org.jgrasstools.gvsig.geopaparazzi/pom.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>

<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>
<artifactId>org.jgrasstools.gvsig.geopaparazzi</artifactId>
<packaging>jar</packaging>
<name>org.jgrasstools.gvsig.geopaparazzi</name>
<description>Geopaparazzi support</description>
<parent>
<groupId>org.jgrasstools</groupId>
<artifactId>org.jgrasstools.gvsig</artifactId>
<version>0.1.0</version>
</parent>

<dependencies>
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.tools.lib</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.andami</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.jgrasstools</groupId>
<artifactId>org.jgrasstools.gvsig.base</artifactId>
<scope>compile</scope>
</dependency>

</dependencies>

<properties>
<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>
<artifactId>org.jgrasstools.gvsig.geopaparazzi</artifactId>
<packaging>jar</packaging>
<name>org.jgrasstools.gvsig.geopaparazzi</name>
<description>Geopaparazzi support</description>
<parent>
<groupId>org.jgrasstools</groupId>
<artifactId>org.jgrasstools.gvsig</artifactId>
<version>0.1.0</version>
</parent>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.tools.lib</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.andami</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.jgrasstools</groupId>
<artifactId>org.jgrasstools.gvsig.base</artifactId>
<scope>compile</scope>
</dependency>

<!-- 3d -->
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.view3d.lib.api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.view3d.swing.api</artifactId>
<scope>compile</scope>
</dependency>

</dependencies>

<properties>
<gvsig.package.info.code>${project.artifactId}</gvsig.package.info.code>
<gvsig.package.info.name>${project.name}</gvsig.package.info.name>
<gvsig.package.info.description>${project.description}</gvsig.package.info.description>
Expand All @@ -53,8 +78,9 @@
<gvsig.package.info.sourcesURL>https://github.com/moovida/hydrologis4gvsig</gvsig.package.info.sourcesURL>
<gvsig.package.info.webURL>https://github.com/moovida/hydrologis4gvsig</gvsig.package.info.webURL>

<gvsig.package.info.dependencies>required: org.jgrasstools.gvsig.base -ge 0.1.0</gvsig.package.info.dependencies>
<gvsig.package.info.dependencies>required: org.jgrasstools.gvsig.base
-ge 0.1.0</gvsig.package.info.dependencies>

</properties>
</properties>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.io.File;
import java.sql.Connection;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
Expand All @@ -46,14 +45,14 @@
import org.gvsig.tools.swing.api.ToolsSwingLocator;
import org.gvsig.tools.swing.api.windowmanager.WindowManager;
import org.gvsig.tools.swing.api.windowmanager.WindowManager.MODE;
import org.jgrasstools.dbs.compat.IJGTConnection;
import org.jgrasstools.gears.io.geopaparazzi.geopap4.DaoGpsLog.GpsLog;
import org.jgrasstools.gears.io.vectorwriter.OmsVectorWriter;
import org.jgrasstools.gears.libs.monitor.IJGTProgressMonitor;
import org.jgrasstools.gears.libs.monitor.LogProgressMonitor;
import org.jgrasstools.gears.utils.files.FileUtilities;
import org.jgrasstools.gvsig.base.DataUtilities;
import org.jgrasstools.gvsig.base.GtGvsigConversionUtilities;
import org.jgrasstools.gvsig.base.JGTUtilities;
import org.jgrasstools.gvsig.base.ProjectUtilities;
import org.jgrasstools.gvsig.base.StyleUtilities;
import org.jgrasstools.gvsig.base.utils.console.LogConsoleController;
Expand Down Expand Up @@ -116,7 +115,7 @@ public void run() {
}

private void loadLayers( IJGTProgressMonitor pm ) throws Exception {
Connection connection = controller.getDatabaseConnection();
IJGTConnection connection = controller.getDatabaseConnection();
File pluginFolder = ProjectUtilities.getPluginFolder(GenerateTilesExtension.class);
doExportShps = controller.doExportShps();
mapContextManager = MapContextLocator.getMapContextManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
import org.gvsig.tools.swing.api.windowmanager.WindowManager;
import org.gvsig.tools.swing.api.windowmanager.WindowManager.MODE;
import org.jgrasstools.dbs.compat.IJGTConnection;
import org.jgrasstools.dbs.spatialite.jgt.SqliteDb;
import org.jgrasstools.gears.io.geopaparazzi.GeopaparazziUtilities;
import org.jgrasstools.gears.io.geopaparazzi.OmsGeopaparazzi4Converter;
import org.jgrasstools.gears.libs.exceptions.ModelsIllegalargumentException;
import org.jgrasstools.gears.libs.monitor.IJGTProgressMonitor;
Expand All @@ -32,34 +35,21 @@ public class GeopaparazziPanelController extends GeopaparazziPanelView {

private static final long serialVersionUID = 1L;

private static boolean hasDriver = false;

static {
try {
// make sure sqlite driver are there
Class.forName("org.sqlite.JDBC");
hasDriver = true;
} catch (Exception e) {
}
}

private ThreadSafeDialogsManager dialogManager;

private Connection databaseConnection;
private IJGTConnection databaseConnection;

private File geopapDatabaseFile;

public GeopaparazziPanelController() {
dialogManager = ToolsSwingLocator.getThreadSafeDialogsManager();

if (!hasDriver) {
dialogManager.messageDialog("Can't find any sqlite driver to open the database. Check your settings.", "ERROR",
JOptionPane.ERROR_MESSAGE);
// throw new ModelsIllegalargumentException("Can't find any sqlite driver. Check your
// settings.", this);
} else {
init();
}
// dialogManager.messageDialog("Can't find any sqlite driver to open the database. Check
// your settings.", "ERROR",
// JOptionPane.ERROR_MESSAGE);
// throw new ModelsIllegalargumentException("Can't find any sqlite driver. Check your
// settings.", this);
init();
}

private void init() {
Expand Down Expand Up @@ -109,14 +99,16 @@ private void openDatabaseFile( File geopapDatabaseFile ) throws Exception {
"The geopaparazzi database file (*.gpap) is missing. Check the inserted path.", this);
}

databaseConnection = DriverManager.getConnection("jdbc:sqlite:" + geopapDatabaseFile.getAbsolutePath());
LinkedHashMap<String, String> metadataMap = OmsGeopaparazzi4Converter.getMetadataMap(databaseConnection);
SqliteDb db = new SqliteDb();
db.open(geopapDatabaseFile.getAbsolutePath());
databaseConnection = db.getConnection();
LinkedHashMap<String, String> metadataMap = GeopaparazziUtilities.getProjectMetadata(databaseConnection);
GeopaparazziMetadata model = new GeopaparazziMetadata(metadataMap);
descriptionTable.setModel(model);

LogProgressMonitor pm = new LogProgressMonitor();
pm.beginTask("Request layers...", IJGTProgressMonitor.UNKNOWN);
List<String> layerNamesList = OmsGeopaparazzi4Converter.getLayerNamesList(databaseConnection);
List<String> layerNamesList = GeopaparazziUtilities.getLayerNamesList(databaseConnection);
DefaultListModel<String> layersModel = new DefaultListModel<String>();
for( String layerName : layerNamesList ) {
layersModel.addElement(layerName);
Expand All @@ -125,7 +117,7 @@ private void openDatabaseFile( File geopapDatabaseFile ) throws Exception {
geopaparazziLayersList.setModel(layersModel);
}

public Connection getDatabaseConnection() {
public IJGTConnection getDatabaseConnection() {
return databaseConnection;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<plugin-config>
<libraries library-dir="lib/"/>
<depends plugin-name="org.jgrasstools.gvsig.base"/>
<depends plugin-name="org.gvsig.view3d.app" />
<resourceBundle name="text"/>
<extensions>
<extension
Expand All @@ -19,11 +20,9 @@
<menu text="JGTools/Geopaparazzi/Create Geopaparazzi Tiles"
name="create-geopaparazzi-tiles" />

<!-- <tool-bar name="Epanet" position="10000">
<action-tool name="create-epanet-project-files" />
</tool-bar> -->

</extension>

<!-- THIS IS NOT READY FOR RELEASE YET
<extension
class-name="org.jgrasstools.gvsig.geopaparazzi.ProjectsViewerExtension"
description="" active="true" priority="2">
Expand All @@ -39,11 +38,8 @@
<menu text="JGTools/Geopaparazzi/Open Projects Viewer"
name="open-geopaparazzi-viewer" />
<!-- <tool-bar name="Epanet" position="10000">
<action-tool name="create-epanet-project-files" />
</tool-bar> -->

</extension>
-->
<extension
class-name="org.jgrasstools.gvsig.geopaparazzi.GeopaparazziMediaOpenerExtension"
description="" active="true" priority="3">
Expand All @@ -59,10 +55,6 @@
<menu text="JGTools/Geopaparazzi/Open Media Images"
name="gpap-media-open-tool" />

<!-- <tool-bar name="Epanet" position="10000">
<action-tool name="create-epanet-project-files" />
</tool-bar> -->

</extension>
</extensions>
</plugin-config>
Expand Down
12 changes: 12 additions & 0 deletions org.jgrasstools.gvsig/org.jgrasstools.gvsig.simpletools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
</parent>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gvsig</groupId>
<artifactId>org.gvsig.tools.lib</artifactId>
Expand Down
Loading

0 comments on commit b138025

Please sign in to comment.