# Follow the instructions to build RL4J but error reported

**URL:** <https://community.konduit.ai/t/follow-the-instructions-to-build-rl4j-but-error-reported/2043>\
**Category:** RL4J\
**Created:** [October 16, 2022, 3:26pm UTC](https://community.konduit.ai/t/follow-the-instructions-to-build-rl4j-but-error-reported/2043 "2022-10-16T15:26:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TempKonduitUser1](https://avatars.discourse-cdn.com/v4/letter/t/76d3ee/32.png) [@TempKonduitUser1](https://community.konduit.ai/u/TempKonduitUser1)\
**Post date:** [October 16, 2022, 3:26pm UTC](https://community.konduit.ai/t/follow-the-instructions-to-build-rl4j-but-error-reported/2043/1 "2022-10-16T15:26:20Z")

</div>

Have followed the instructions to build RL4J from [RL4J](https://github.com/kgoderis/deeplearning4j/tree/rl4j-refactor/rl4j) by the instruction:  
_mvn install_  
but it reported the following error:  
_…_  
_[INFO] ------------------------------------------------------------------------_  
_[INFO] Reactor Summary for rl4j 1.0.0-SNAPSHOT:_  
_[INFO]_  
_[INFO] rl4j … FAILURE [2.552 s]_  
_[INFO] rl4j-api … SKIPPED_  
_[INFO] rl4j-core … SKIPPED_  
_[INFO] rl4j-gym … SKIPPED_  
_[INFO] rl4j-doom … SKIPPED_  
_[INFO] rl4j-ale … SKIPPED_  
_[INFO] rl4j-malmo … SKIPPED_  
_[INFO] ------------------------------------------------------------------------_  
_[INFO] BUILD FAILURE_  
_[INFO] ------------------------------------------------------------------------_  
_[INFO] Total time: 3.489 s_  
_[INFO] Finished at: 2022-10-16T23:11:10+08:00_  
_[INFO] ------------------------------------------------------------------------_  
_[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce-choice-of-nd4j-test-backend) on project rl4j: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. → [Help 1]_  
_[ERROR]_  
_[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch._  
_[ERROR] Re-run Maven using the -X switch to enable full debug logging._  
_[ERROR]_  
_[ERROR] For more information about the errors and possible solutions, please read the following articles:_  
_[ERROR] [Help 1] [MojoExecutionException - Apache Maven - Apache Software Foundation](http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException)_  
What could be the cause? How to fix it? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)\
**Post date:** [October 16, 2022, 3:43pm UTC](https://community.konduit.ai/t/follow-the-instructions-to-build-rl4j-but-error-reported/2043/2 "2022-10-16T15:43:10Z")

</div>

> [@TempKonduitUser1](#):
>
> Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.

Take a look further up in your log and look for “enforcer” or something like that, it will tell you exactly what the issue is.

---

<div class="post-metadata">

**Author:** ![TempKonduitUser1](https://avatars.discourse-cdn.com/v4/letter/t/76d3ee/32.png) [@TempKonduitUser1](https://community.konduit.ai/u/TempKonduitUser1)\
**Post date:** [October 17, 2022, 11:57am UTC](https://community.konduit.ai/t/follow-the-instructions-to-build-rl4j-but-error-reported/2043/3 "2022-10-17T11:57:25Z")

</div>

Hi, dear treo. Thanks for your reply. The last debug output is something like:

_[INFO] — maven-enforcer-plugin:1.4.1:enforce (enforce-choice-of-nd4j-test-backend) @ rl4j —_  
_[DEBUG] Configuring mojo org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce from plugin realm ClassRealm[plugin\>org.apache.maven.plugins:maven-enforcer-plugin:1.4.1, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@6d5380c2]_  
_[DEBUG] Configuring mojo ‘org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce’ with basic configurator →_   
_[DEBUG] (s) fail = true_  
_[DEBUG] (s) failFast = false_  
_[DEBUG] (f) ignoreCache = false_  
_[DEBUG] (f) mojoExecution = org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce {execution: enforce-choice-of-nd4j-test-backend}_  
_[DEBUG] (s) project = MavenProject: org.deeplearning4j:rl4j:1.0.0-SNAPSHOT @ D:\deeplearning4j\rl4j\pom.xml_  
_[DEBUG] (s) profiles = nd4j-tests-cpu,nd4j-tests-cuda_  
_[DEBUG] (s) all = false_  
_[DEBUG] (s) rules = [org.apache.maven.plugins.enforcer.RequireActiveProfile@e706aa]_  
_[DEBUG] (s) session = org.apache.maven.execution.MavenSession@37baddde_  
_[DEBUG] (s) skip = false_  
_[DEBUG] – end configuration –_  
_[DEBUG] Executing rule: org.apache.maven.plugins.enforcer.RequireActiveProfile_  
_[DEBUG] Adding failure due to exception_  
_org.apache.maven.enforcer.rule.api.EnforcerRuleException: Profile “nd4j-tests-cpu” is not activated._  
_Profile “nd4j-tests-cuda” is not activated._

- at org.apache.maven.plugins.enforcer.RequireActiveProfile.execute (RequireActiveProfile.java:121)\*
- at org.apache.maven.plugins.enforcer.EnforceMojo.execute (EnforceMojo.java:193)\*
- at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)\*
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)\*
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)\*
- at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)\*
- at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)\*
- at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)\*
- at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)\*
- at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)\*
- at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)\*
- at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)\*
- at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)\*
- at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)\*
- at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)\*
- at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)\*
- at java.lang.reflect.Method.invoke (Method.java:566)\*
- at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)\*
- at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)\*
- at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)\*
- at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)\*  
_[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireActiveProfile failed with message:_  
_Profile “nd4j-tests-cpu” is not activated._  
_Profile “nd4j-tests-cuda” is not activated._

_[INFO] ------------------------------------------------------------------------_  
_[INFO] Reactor Summary for rl4j 1.0.0-SNAPSHOT:_  
_[INFO]_  
_[INFO] rl4j … FAILURE [4.209 s]_  
_[INFO] rl4j-api … SKIPPED_  
_[INFO] rl4j-core … SKIPPED_  
_[INFO] rl4j-gym … SKIPPED_  
_[INFO] rl4j-doom … SKIPPED_  
_[INFO] rl4j-ale … SKIPPED_  
_[INFO] rl4j-malmo … SKIPPED_  
_[INFO] ------------------------------------------------------------------------_  
_[INFO] BUILD FAILURE_  
_[INFO] ------------------------------------------------------------------------_  
_[INFO] Total time: 5.403 s_  
_[INFO] Finished at: 2022-10-17T19:46:29+08:00_  
_[INFO] ------------------------------------------------------------------------_  
_[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce-choice-of-nd4j-test-backend) on project rl4j: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. → [Help 1]_  
_org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce-choice-of-nd4j-test-backend) on project rl4j: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed._

- at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:375)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)\*
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)\*
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)\*
- at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)\*
- at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)\*
- at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)\*
- at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)\*
- at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)\*
- at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)\*
- at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)\*
- at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)\*
- at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)\*
- at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)\*
- at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)\*
- at java.lang.reflect.Method.invoke (Method.java:566)\*
- at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)\*
- at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)\*
- at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)\*
- at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)\*  
_Caused by: org.apache.maven.plugin.MojoExecutionException: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed._
- at org.apache.maven.plugins.enforcer.EnforceMojo.execute (EnforceMojo.java:237)\*
- at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)\*
- at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)\*
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)\*
- at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)\*
- at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)\*
- at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)\*
- at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)\*
- at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)\*
- at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)\*
- at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)\*
- at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)\*
- at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)\*
- at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)\*
- at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)\*
- at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)\*
- at java.lang.reflect.Method.invoke (Method.java:566)\*
- at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)\*
- at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)\*
- at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)\*
- at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)\*  
_[ERROR]_  
_[ERROR]_  
_[ERROR] For more information about the errors and possible solutions, please read the following articles:_  
_[ERROR] [Help 1] [MojoExecutionException - Apache Maven - Apache Software Foundation](http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException)_

How can I activate “nd4j-tests-cpu” and “nd4j-tests-cuda”? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)\
**Post date:** [October 17, 2022, 12:02pm UTC](https://community.konduit.ai/t/follow-the-instructions-to-build-rl4j-but-error-reported/2043/4 "2022-10-17T12:02:18Z")

</div>

It looks like you are building with tests enabled. Disable them with `-DskipTests=true` on the `mvn` command line.
