Shield Custom Realm Sample not Compiling

security

(Yashodhara) #1

Hi,

I have dowloaded Shield Custom realm sample from GitHub to compile it and execute it so that later will be developing our own custom realm for our project, However when I try to compile i get the missing artifact and dependency error.

Belwo is the POM the head section..



org.elasticsearch.plugin
plugins
3.0.0-SNAPSHOT

4.0.0

Questions -- ?

Why is it giving "Missing artifact org.elasticsearch:elasticsearch:jar:tests:3.0.0-SNAPSHOT" ?
Do I need any special shield access to get all the dependencies related to Shield plugin??
Any thing specific to elasticsearch do i need access to or should i download to my repository?

Please help me with this issue.

In MAVEN debug mode ..

[DEBUG] =======================================================================
[DEBUG] Could not find metadata org.elasticsearch:elasticsearch:3.0.0-SNAPSHOT/maven-metadata.xml in local (C:\Users\xxxx.m2\repository)
[DEBUG] Failure to find org.elasticsearch:elasticsearch:3.0.0-SNAPSHOT/maven-metadata.xml in https://download.elasticsearch.org/lucenesnapshots/1710880 was cached in the local repository, resolution will not be reattempted until the update interval of Lucene snapshots has elapsed or updates are forced
[DEBUG] Skipped remote request for org.elasticsearch:elasticsearch:3.0.0-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.

And stack trace ...

[ERROR] Failed to execute goal on project shield-custom-realm-example: Could not resolve dependencies for project org.elasticsearch.plugin:shield-custom-realm-example:jar:3.0.0-SNAPSHOT: The following artifacts could not be resolved: org.elasticsearch.plugin:shield:jar:3.0.0-SNAPSHOT, org.elasticsearch:elasticsearch:jar:tests:3.0.0-SNAPSHOT: Could not find artifact org.elasticsearch.plugin:shield:jar:3.0.0-SNAPSHOT in oss-snapshots (https://oss.sonatype.org/content/repositories/snapshots/) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project shield-custom-realm-example: Could not resolve dependencies for project org.elasticsearch.plugin:shield-custom-realm-example:jar:3.0.0-SNAPSHOT: The following artifacts could not be resolved: org.elasticsearch.plugin:shield:jar:3.0.0-SNAPSHOT, org.elasticsearch:elasticsearch:jar:tests:3.0.0-SNAPSHOT: Could not find artifact org.elasticsearch.plugin:shield:jar:3.0.0-SNAPSHOT in oss-snapshots (https://oss.sonatype.org/content/repositories/snapshots/)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:245)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:199)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)


(Jay Modi) #2

Hi @Yasho,

What version of elasticsearch and shield will you be using? For 2.3, please checkout the 2.3 branch. I'll update it later today to use the latest versions. If you are wanting to try with the latest 5.0 alpha, you can checkout the gradle branch.

-Jay


(Yashodhara) #3

Hi Jay,

I have got ES & shield 2.2.1, i have got these installed over my ubuntu box, however got the custom realm downloaded on my laptop to be compiled and modified using eclipse Luna.

so do i download version 2.2 for custom realm & do i need 2 install ES & Shield on my laptop as well?

~ Yasho


(Jay Modi) #4

You can checkout the tag for 2.2.1 to get an example that works for your version. git checkout v2.2.1 and then you should be able to build a compatible version. You do not need to install es/shield on your laptop unless you want to manually test the plugin on your laptop.


(Romain DEQUIDT) #5

Hi,

I "checkout the gradle branch" and tried to build it.

But the "org.elasticsearch.plugin:x-pack:5.0.0-alpha4" library is not retreived.

Is that related to the "not found" error from the maven repository?

https://mvnrepository.com/artifact/org.elasticsearch.plugin/x-pack

Thanks in advance for your answer, i try to develop a elastic-custom-realm but the first step is blocking me :confused:


(Jay Modi) #6

Hi @romain.dequidt,

I've just pushed an update to that branch. Can you please try again? The x-pack artifacts are hosted on our own repository and are not publish to maven central.

Also, next time it is probably better to create a new thread.

Jay


(Romain DEQUIDT) #7

[quote="shell"]$gradle

FAILURE: Build failed with an exception.

  • Where:
    Build file '/home/rom/Documents/rtone/elastic/shield-custom-realm-example/build.gradle' line: 36

  • What went wrong:
    A problem occurred evaluating root project 'shield-custom-realm-example'.

Failed to apply plugin [id 'carrotsearch.randomized-testing']
Could not create task of type 'RandomizedTestingTask'.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.97 secs
[/quote]

FYI.


(Jay Modi) #8

Can you run with --stacktrace to see what's causing this? I haven't seen this issue and just cleared my local artifacts out. Also, what version of gradle are you using?


(Romain DEQUIDT) #9

You're right.
Gradle 3 failed
Gradle 2.14.* failed
Gradle 2.13 succeeded
Thanks for your help.


(system) #10