anchor.diff:  [[nexus-connecting-to-nexus]]
   == Connecting to Nexus
   
  -The next steps demonstrate defining a build that will use the new Nexus
  -repository.  The rest of the tutorial will be using
  -link:https://github.com/openshift/jee-ex.git[this example repository]
  -with *wildfly-100-centos7* as a builder, but these changes should work for any
  -project.
  +The next steps demonstrate defining a build that uses the new Nexus repository.
  +The rest of the tutorial uses link:https://github.com/openshift/jee-ex.git[this
  +example repository] with *wildfly-100-centos7* as a builder, but these changes
  +should work for any project.
   
  -The example builder image, *wildfly-100-centos7* supports `*MAVEN_MIRROR_URL*` as
  -part of its environment, so we can use this to point our builder image to our
  -Nexus repository. If your image does not support consuming an environment
  -variable to configure a Maven mirror, you may need to modify the builder image
  -to provide the correct Maven settings to point to the Nexus mirror.
  +The link:https://github.com/openshift/jee-ex.git[example builder image] supports
  +`*MAVEN_MIRROR_URL*` as part of its environment, so we can use this to point our
  +builder image to our Nexus repository. If your image does not support consuming
  +an environment variable to configure a Maven mirror, you may need to modify the
  +builder image to provide the correct Maven settings to point to the Nexus
  +mirror.
   
   ----
   $ oc new-build openshift/wildfly-100-centos7:latest~https://github.com/openshift/jee-ex.git \
  
positive.code: link:https://books.sonatype.com/nexus-book/reference/config.html[the Nexus documentation]
  to configure your build properly.
  
  Furthermore, make sure that you give each pod enough resources to
  function. You may have to edit the pod template in the Nexus deployment
  configuration to request more resources.
  xref:../deployment#creating-a-deployment-configuration[Learn more about setting deployment resources in pod templates].
  
  [[nexus-setting-up-nexus]]
  == Setting up Nexus
  
  Use `new-app` to download and deploy the official Nexus container image.
  
  ----
  oc new-app sonatype/nexus
  ----
  
  Create a route by exposing the newly created Nexus service:
  
  ----
  oc expose svc/nexus
  ----
  
  Use *oc get routes* to find the pod's new external address.
  
  ----
  oc get routes
  ----
  
  The output should resemble:
  
  ----
  NAME      HOST/PORT                              PATH      SERVICES   PORT       TERMINATION
  nexus     nexus-myproject.192.168.1.173.xip.io             nexus      8081-tcp
  ----
  
  Confirm that Nexus is running by navigating your browser to the URL under
  *HOST/PORT*. To sign in to Nexus, the default administrator username is *admin*,
  and the password is *admin123*.
  
  Nexus comes pre-configured for the Central Repository, but you may need others
  for your application.  For many Red Hat images, it is recommended to add the
  *jboss-ga* repository at *_https://maven.repository.redhat.com/ga/_*.
  link:https://books.sonatype.com/nexus-book/reference/config-maven.html[Learn how to add repositories].
  
  [[nexus-using-probes-to-check-for-success]]
  === Using Probes to Check for Success
  
  This is a good time to set up readiness and liveness probes. These will
  periodically check to see that Nexus is running properly.
  xref:../application_health.adoc#dev-guide-application-health[Learn more about probes].
  
  ----
  $ oc set probe dc/nexus \
  
negative.code: [[nexus-confirming-success]]
  == Confirming Success
  
  In your web browser, navigate to *_http://<Nexus
  IP>:8081/content/groups/public_* to confirm that it has stored your
  application's dependencies. You can also check the build logs to see if Maven is
  using the Nexus mirror. If successful, you should see output referencing the URL
  *_http://nexus:8081_*.
  
  [[nexus-additional-resources]]
  == Additional Resources
  * xref:../../dev_guide/volumes.adoc#dev-guide-volumes[Managing Volumes in {product-title}]
  * link:https://blog.openshift.com/improving-build-time-java-builds-openshift/[Improving Build Time of Java Builds on {product-title}]
  * link:https://books.sonatype.com/nexus-book/reference/index.html[Nexus Repository Documentation]
  