Java API noob question


(ppearcy) #1

Hopefully a quick question...

I get that the Java APIs are in a maven repository hosted by sonatype.
I've spent a few minutes reading around on maven and how it uses
repositories, but don't feel any closer to answering my question. I'm
sure I could figure this out eventually...

Can somebody give me details on the correct way to pull these down?

Thanks,
Paul


(Lukáš Vlček) #2

Hi,

the following is what works fine for me:

  1. First of all you need to install maven on your machine.
    http://maven.apache.org/
    http://maven.apache.org/2) You need some maven repository to pull ES
    artifacts from. There are two options:
    a) you can pull from sonatype repository (in this case you want to use
    some of releases installed there or the SNAPSHOT version)
    b) you want to use the most recent version of ES which is built or
    modified locally. In this case it is better to pull from your local maven
    repo (typically located in .m2/repository folder). It is pretty easy to
    install the most recent artifact into your local repo by issuing the
    following gradle commands in the ES root folder:

gradlew clean release install

Then you need to declare dependency in your pom.xml file. The following is
example which follows the scenario b) above.

    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <!--
            Assume ElasticSearch is installed in local mvn repository.
            You can install it into local repo using: > gradlew clean

release install
-->
0.9.1-SNAPSHOT


com.sun.jmx
jmxri


com.sun.jdmk
jmxtools


javax.jms
jms


javax.mail
mail


Note: If I remember correctly then those are used because of
log4j.1.2.16 dependencies (these transitive dependencies are not needed and
are problematic w/t maven dependency mechanism as there are some licencing
issues on the Sun/Oracle side).

If you want to use sonatype repository as opposed to local repository then
there are many ways how you can tell maven to use it. Probably the most
explicit one is to add sonatype repository directly into your pom.xml file.
The following you can find more info about how to do it:
http://maven.apache.org/guides/introduction/introduction-to-repositories.html

Regards,
Lukas

On Tue, Aug 24, 2010 at 8:42 PM, Paul ppearcy@gmail.com wrote:

Hopefully a quick question...

I get that the Java APIs are in a maven repository hosted by sonatype.
I've spent a few minutes reading around on maven and how it uses
repositories, but don't feel any closer to answering my question. I'm
sure I could figure this out eventually...

Can somebody give me details on the correct way to pull these down?

Thanks,
Paul


(ppearcy) #3

Thanks! I will give it a try, and should be able to figure out what I
am doing with this info.

On Aug 24, 1:57 pm, Lukáš Vlček lukas.vl...@gmail.com wrote:

Hi,

the following is what works fine for me:

  1. First of all you need to install maven on your machine.http://maven.apache.org/
    http://maven.apache.org/2) You need some maven repository to pull ES
    artifacts from. There are two options:
    a) you can pull from sonatype repository (in this case you want to use
    some of releases installed there or the SNAPSHOT version)
    b) you want to use the most recent version of ES which is built or
    modified locally. In this case it is better to pull from your local maven
    repo (typically located in .m2/repository folder). It is pretty easy to
    install the most recent artifact into your local repo by issuing the
    following gradle commands in the ES root folder:

gradlew clean release install

Then you need to declare dependency in your pom.xml file. The following is
example which follows the scenario b) above.

    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <!--
            Assume ElasticSearch is installed in local mvn repository.
            You can install it into local repo using: > gradlew clean

release install
-->
0.9.1-SNAPSHOT


com.sun.jmx
jmxri


com.sun.jdmk
jmxtools


javax.jms
jms


javax.mail
mail


Note: If I remember correctly then those are used because of
log4j.1.2.16 dependencies (these transitive dependencies are not needed and
are problematic w/t maven dependency mechanism as there are some licencing
issues on the Sun/Oracle side).

If you want to use sonatype repository as opposed to local repository then
there are many ways how you can tell maven to use it. Probably the most
explicit one is to add sonatype repository directly into your pom.xml file.
The following you can find more info about how to do it:http://maven.apache.org/guides/introduction/introduction-to-repositor...

Regards,
Lukas

On Tue, Aug 24, 2010 at 8:42 PM, Paul ppea...@gmail.com wrote:

Hopefully a quick question...

I get that the Java APIs are in a maven repository hosted by sonatype.
I've spent a few minutes reading around on maven and how it uses
repositories, but don't feel any closer to answering my question. I'm
sure I could figure this out eventually...

Can somebody give me details on the correct way to pull these down?

Thanks,
Paul


(Shay Banon) #4

If you just want the jar files, then its in the distribution called
elasticsearch-XXX.jar. You don't need anything else. You don't have to use
maven or maven repos if you don't want to.

-shay.banon

On Tue, Aug 24, 2010 at 10:59 PM, Paul ppearcy@gmail.com wrote:

Thanks! I will give it a try, and should be able to figure out what I
am doing with this info.

On Aug 24, 1:57 pm, Lukáš Vlček lukas.vl...@gmail.com wrote:

Hi,

the following is what works fine for me:

  1. First of all you need to install maven on your machine.
    http://maven.apache.org/
    http://maven.apache.org/2) You need some maven repository to pull ES
    artifacts from. There are two options:
    a) you can pull from sonatype repository (in this case you want to use
    some of releases installed there or the SNAPSHOT version)
    b) you want to use the most recent version of ES which is built or
    modified locally. In this case it is better to pull from your local maven
    repo (typically located in .m2/repository folder). It is pretty easy to
    install the most recent artifact into your local repo by issuing the
    following gradle commands in the ES root folder:

gradlew clean release install

Then you need to declare dependency in your pom.xml file. The following
is
example which follows the scenario b) above.

    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <!--
            Assume ElasticSearch is installed in local mvn

repository.

            You can install it into local repo using: > gradlew clean

release install
-->
0.9.1-SNAPSHOT


com.sun.jmx
jmxri


com.sun.jdmk
jmxtools


javax.jms
jms


javax.mail
mail


Note: If I remember correctly then those are used because
of
log4j.1.2.16 dependencies (these transitive dependencies are not needed
and
are problematic w/t maven dependency mechanism as there are some
licencing
issues on the Sun/Oracle side).

If you want to use sonatype repository as opposed to local repository
then
there are many ways how you can tell maven to use it. Probably the most
explicit one is to add sonatype repository directly into your pom.xml
file.
The following you can find more info about how to do it:
http://maven.apache.org/guides/introduction/introduction-to-repositor...

Regards,
Lukas

On Tue, Aug 24, 2010 at 8:42 PM, Paul ppea...@gmail.com wrote:

Hopefully a quick question...

I get that the Java APIs are in a maven repository hosted by sonatype.
I've spent a few minutes reading around on maven and how it uses
repositories, but don't feel any closer to answering my question. I'm
sure I could figure this out eventually...

Can somebody give me details on the correct way to pull these down?

Thanks,
Paul


(ppearcy) #5

Ah, that is easy. Thanks Shay and Lukas!

On Aug 24, 2:22 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

If you just want the jar files, then its in the distribution called
elasticsearch-XXX.jar. You don't need anything else. You don't have to use
maven or maven repos if you don't want to.

-shay.banon

On Tue, Aug 24, 2010 at 10:59 PM, Paul ppea...@gmail.com wrote:

Thanks! I will give it a try, and should be able to figure out what I
am doing with this info.

On Aug 24, 1:57 pm, Lukáš Vlček lukas.vl...@gmail.com wrote:

Hi,

the following is what works fine for me:

  1. First of all you need to install maven on your machine.
    http://maven.apache.org/
    http://maven.apache.org/2) You need some maven repository to pull ES
    artifacts from. There are two options:
    a) you can pull from sonatype repository (in this case you want to use
    some of releases installed there or the SNAPSHOT version)
    b) you want to use the most recent version of ES which is built or
    modified locally. In this case it is better to pull from your local maven
    repo (typically located in .m2/repository folder). It is pretty easy to
    install the most recent artifact into your local repo by issuing the
    following gradle commands in the ES root folder:

gradlew clean release install

Then you need to declare dependency in your pom.xml file. The following
is
example which follows the scenario b) above.

    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <!--
            Assume ElasticSearch is installed in local mvn

repository.

            You can install it into local repo using: > gradlew clean

release install
-->
0.9.1-SNAPSHOT


com.sun.jmx
jmxri


com.sun.jdmk
jmxtools


javax.jms
jms


javax.mail
mail


Note: If I remember correctly then those are used because
of
log4j.1.2.16 dependencies (these transitive dependencies are not needed
and
are problematic w/t maven dependency mechanism as there are some
licencing
issues on the Sun/Oracle side).

If you want to use sonatype repository as opposed to local repository
then
there are many ways how you can tell maven to use it. Probably the most
explicit one is to add sonatype repository directly into your pom.xml
file.
The following you can find more info about how to do it:
http://maven.apache.org/guides/introduction/introduction-to-repositor...

Regards,
Lukas

On Tue, Aug 24, 2010 at 8:42 PM, Paul ppea...@gmail.com wrote:

Hopefully a quick question...

I get that the Java APIs are in a maven repository hosted by sonatype.
I've spent a few minutes reading around on maven and how it uses
repositories, but don't feel any closer to answering my question. I'm
sure I could figure this out eventually...

Can somebody give me details on the correct way to pull these down?

Thanks,
Paul


(system) #6