# Shield Custom Realm Sample not Compiling

**URL:** <https://discuss.elastic.co/t/shield-custom-realm-sample-not-compiling/56733>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [July 29, 2016, 2:02pm UTC](https://discuss.elastic.co/t/shield-custom-realm-sample-not-compiling/56733 "2016-07-29T14:02:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yasho](https://avatars.discourse-cdn.com/v4/letter/y/c2a13f/32.png) [@Yasho](https://discuss.elastic.co/u/Yasho)\
**Post date:** [July 29, 2016, 2:02pm UTC](https://discuss.elastic.co/t/shield-custom-realm-sample-not-compiling/56733/1 "2016-07-29T14:02:16Z")

</div>

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](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/](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/](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)

---

<div class="post-metadata">

**Author:** ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)\
**Post date:** [July 29, 2016, 2:26pm UTC](https://discuss.elastic.co/t/shield-custom-realm-sample-not-compiling/56733/2 "2016-07-29T14:26:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Yasho](https://avatars.discourse-cdn.com/v4/letter/y/c2a13f/32.png) [@Yasho](https://discuss.elastic.co/u/Yasho)\
**Post date:** [July 30, 2016, 7:52am UTC](https://discuss.elastic.co/t/shield-custom-realm-sample-not-compiling/56733/3 "2016-07-30T07:52:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)\
**Post date:** [August 1, 2016, 11:14am UTC](https://discuss.elastic.co/t/shield-custom-realm-sample-not-compiling/56733/4 "2016-08-01T11:14:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![romain.dequidt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/romain.dequidt/32/11809_2.png) [@romain.dequidt](https://discuss.elastic.co/u/romain.dequidt)\
**Post date:** [September 8, 2016, 10:02am UTC](https://discuss.elastic.co/t/shield-custom-realm-sample-not-compiling/56733/5 "2016-09-08T10:02:26Z")

</div>

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](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 😕

---

<div class="post-metadata">

**Author:** ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)\
**Post date:** [September 8, 2016, 11:44am UTC](https://discuss.elastic.co/t/shield-custom-realm-sample-not-compiling/56733/6 "2016-09-08T11:44:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![romain.dequidt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/romain.dequidt/32/11809_2.png) [@romain.dequidt](https://discuss.elastic.co/u/romain.dequidt)\
**Post date:** [September 8, 2016, 3:30pm UTC](https://discuss.elastic.co/t/shield-custom-realm-sample-not-compiling/56733/7 "2016-09-08T15:30:29Z")

</div>

[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.

---

<div class="post-metadata">

**Author:** ![jaymode](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaymode/32/50103_2.png) [@jaymode](https://discuss.elastic.co/u/jaymode)\
**Post date:** [September 8, 2016, 4:03pm UTC](https://discuss.elastic.co/t/shield-custom-realm-sample-not-compiling/56733/8 "2016-09-08T16:03:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![romain.dequidt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/romain.dequidt/32/11809_2.png) [@romain.dequidt](https://discuss.elastic.co/u/romain.dequidt)\
**Post date:** [September 9, 2016, 8:03am UTC](https://discuss.elastic.co/t/shield-custom-realm-sample-not-compiling/56733/9 "2016-09-09T08:03:15Z")

</div>

> [@jaymode](#):
>
> what version of gradle are you using?

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:41pm UTC](https://discuss.elastic.co/t/shield-custom-realm-sample-not-compiling/56733/10 "2017-07-06T13:41:55Z")

</div>


