How to download maven dependency as *.jar file?

JavaDev :

I attempt to implement the example from here, but upon the Maven dependencies installation I can't find jar file amongst downloaded dependencies.

My pom.xml looks like this:

<?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>

    <!-- This is often your domain name (reversed.)  -->
    <groupId>com.abc</groupId>
    <!-- The name of this project (actually, the name of the artifact, which is the thing that this project produces. A jar in this case.) -->
    <artifactId>javaparser-maven-sample</artifactId>
    <!-- The version of this project. SNAPSHOT means "we're still working on it" -->
    <version>1.0-SNAPSHOT</version>

    <properties>
        <!-- Tell Maven we want to use Java 8 -->
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <!-- Tell Maven to treat all source files as UTF-8 -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <geotools.version>2.5.7</geotools.version>
    </properties>
   <repositories>
    <repository>
        <id>maven2-repository.dev.java.net</id>
        <name>Java.net repository</name>
        <url>http://download.java.net/maven/2</url>
    </repository>
    <repository>
        <id>osgeo</id>
        <name>Open Source Geospatial Foundation Repository</name>
        <url>http://download.osgeo.org/webdav/geotools/</url>
    </repository>
    <repository> <!--Add the snapshot repository here-->
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <id>opengeo</id>
        <name>OpenGeo Maven Repository</name>
        <url>http://repo.opengeo.org</url>
    </repository>
</repositories>

    <dependencies>
        <!-- Here are all your dependencies. Currently only one. These are automatically downloaded from https://mvnrepository.com/ -->
        <dependency>
            <groupId>com.github.javaparser</groupId>
            <artifactId>javaparser-core</artifactId>
            <version>3.15.21</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/mil.nga.geopackage/geopackage -->
        <dependency>
            <groupId>mil.nga.geopackage</groupId>
            <artifactId>geopackage</artifactId>
            <version>3.5.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.geotools/gt-api -->
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-api</artifactId>
            <version>20.5</version>
        </dependency>

    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-epsg-hsql</artifactId>
        <version>${geotools.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.geotools/gt-geometry -->
    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-geometry</artifactId>
        <version>2.5-M2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.geotools/gt-referencing -->
    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-referencing</artifactId>
        <version>17.1</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.locationtech.jts.io/jts-io-common -->
    <dependency>
        <groupId>org.locationtech.jts.io</groupId>
        <artifactId>jts-io-common</artifactId>
        <version>1.16.1</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.opengis/geoapi -->
    <dependency>
        <groupId>org.opengis</groupId>
        <artifactId>geoapi</artifactId>
        <version>3.0.0</version>
    </dependency>
    
    <!-- https://mvnrepository.com/artifact/org.geotools/gt-jts-wrapper -->
<dependency>
    <groupId>org.geotools</groupId>
    <artifactId>gt-jts-wrapper</artifactId>
    <version>17.0</version>
    <scope>test</scope>
</dependency>
    <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-swing</artifactId>
            <version>17.0</version>
        </dependency>

    
    
    </dependencies>

    <!-- This blob of configuration tells Maven to make the jar executable. You can run it with:
    mvn clean package
    java -jar target/javaparser-maven-sample-1.0-SNAPSHOT-shaded.jar
    -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <transformers>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>com.abc.conversion.LogicPositivizer</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

I am able to download all the jars except geotools related jars. When I clean and run the project, in the .m2 folder I am not able to see the geotool related jars. Even in the maven repository I am not able to download the jar file.

Maven repo

Is there any alternative way to proceed?

GeoMesaJim :

The repository run by Boundless has been replaced by one hosted by OSGeo. The OSGeo webdav repo was merged into the new OSGeo repo. Details are here (https://docs.geotools.org/latest/userguide/tutorial/quickstart/maven.html)

Replace this block

<repository>
    <id>osgeo</id>
    <name>Open Source Geospatial Foundation Repository</name>
    <url>http://download.osgeo.org/webdav/geotools/</url>
</repository>
<repository> <!--Add the snapshot repository here-->
    <snapshots>
        <enabled>true</enabled>
    </snapshots>
    <id>opengeo</id>
    <name>OpenGeo Maven Repository</name>
    <url>http://repo.opengeo.org</url>
</repository>

with

  <repository>
    <id>osgeo</id>
    <name>OSGeo Release Repository</name>
    <url>https://repo.osgeo.org/repository/release/</url>
    <snapshots><enabled>false</enabled></snapshots>
    <releases><enabled>true</enabled></releases>
  </repository>
  <repository>
    <id>osgeo-snapshot</id>
    <name>OSGeo Snapshot Repository</name>
    <url>https://repo.osgeo.org/repository/snapshot/</url>
    <snapshots><enabled>true</enabled></snapshots>
    <releases><enabled>false</enabled></releases>
  </repository>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How to download sources for an specific JAR dependency of a Maven project

From Dev

maven: how to build the dependency from source.jar to jar files and put the jar file as it dependency?

From Dev

how to add jar dependency in maven?

From Java

How to download sources for a jar with Maven?

From Dev

maven dependency jar file displayed as folder icon

From Dev

Maven not finding dependency with only jar file

From Java

How to find the usage of a jar imported by maven dependency?

From Java

How to get path to dependency jar with maven

From Dev

How to add dependency to maven project? (How to find out GroupID / ArtifactID from external jar file)

From Dev

How to include resource file into osgi bundle from jar dependency with bnd/maven-bundle-plugin?

From Java

How to add local jar to fat jar as a dependency using maven?

From Java

Maven dependency to jar in Nexus

From Java

<Maven>How to add class files as dependency (not jar) in maven project?

From Java

maven copy a particular dependency jar to a specific directory in the .war file

From Java

Maven clean install not including sqlite dependency for executable jar file

From Dev

Need to create Java JAR file and add it to Maven Dependency

From Java

Is there a way to create maven dependency in pom file from a local jar

From Java

Maven dependency plugin - exclude directories when unpackaging jar file

From Dev

Does sbt/maven includes the complete dependency in jar file?

From Dev

How to get the file path location of a .jar dependency?

From Java

How to add a dependency into a jar file in java

From Dev

How to modify a file contained in a JAR that is a dependency in IntelliJ

From Dev

How to read a file from a Maven dependency project?

From Dev

how to specify dll file as dependency to maven runtime

From Java

download and execute jar file from remote maven repository

From Java

wget not working to download jar file from maven repo

From Dev

How to create a jar with Maven that includes dependencies in a separate folder for each dependency

From Java

How to add local project (not jar) as a dependency to a Maven project

From Java

How can I remove maven dependency jar in Eclipse

Related Related

  1. 1

    How to download sources for an specific JAR dependency of a Maven project

  2. 2

    maven: how to build the dependency from source.jar to jar files and put the jar file as it dependency?

  3. 3

    how to add jar dependency in maven?

  4. 4

    How to download sources for a jar with Maven?

  5. 5

    maven dependency jar file displayed as folder icon

  6. 6

    Maven not finding dependency with only jar file

  7. 7

    How to find the usage of a jar imported by maven dependency?

  8. 8

    How to get path to dependency jar with maven

  9. 9

    How to add dependency to maven project? (How to find out GroupID / ArtifactID from external jar file)

  10. 10

    How to include resource file into osgi bundle from jar dependency with bnd/maven-bundle-plugin?

  11. 11

    How to add local jar to fat jar as a dependency using maven?

  12. 12

    Maven dependency to jar in Nexus

  13. 13

    <Maven>How to add class files as dependency (not jar) in maven project?

  14. 14

    maven copy a particular dependency jar to a specific directory in the .war file

  15. 15

    Maven clean install not including sqlite dependency for executable jar file

  16. 16

    Need to create Java JAR file and add it to Maven Dependency

  17. 17

    Is there a way to create maven dependency in pom file from a local jar

  18. 18

    Maven dependency plugin - exclude directories when unpackaging jar file

  19. 19

    Does sbt/maven includes the complete dependency in jar file?

  20. 20

    How to get the file path location of a .jar dependency?

  21. 21

    How to add a dependency into a jar file in java

  22. 22

    How to modify a file contained in a JAR that is a dependency in IntelliJ

  23. 23

    How to read a file from a Maven dependency project?

  24. 24

    how to specify dll file as dependency to maven runtime

  25. 25

    download and execute jar file from remote maven repository

  26. 26

    wget not working to download jar file from maven repo

  27. 27

    How to create a jar with Maven that includes dependencies in a separate folder for each dependency

  28. 28

    How to add local project (not jar) as a dependency to a Maven project

  29. 29

    How can I remove maven dependency jar in Eclipse

HotTag

Archive