{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/76420136","id":76420136,"diff_hunk":"@@ -0,0 +1,222 @@\n+# OpenShift + Maven + Nexus Tutorial\n+\n+While developing your application with Java and Maven, you'll most likely be\n+building many times. In order to shorten the build times of your\n+pods, Maven dependencies can be cached in a local Nexus repository.  This\n+tutorial will step you through integrating a Nexus repository into your project.\n+\n+| Content: |\n+|:----------------------------|\n+|[Prerequisites](#prerequisites)|\n+|[Setting up Nexus](#setting-up-nexus)|\n+|[Modifying the Builder](#modifying-the-builder)|\n+|[See Also](#see-also)|\n+\n+## Prerequisites\n+\n+This tutorial assumes that you'll be working with a project that is already set\n+up for use with Maven.  If you're interested in using Maven with your Java\n+project, we highly recommend looking at\n+[their guide](https://maven.apache.org/guides/getting-started/index.html).\n+\n+## Setting up Nexus\n+\n+Download the official Nexus Docker image and use `new-app` to deploy it.\n+```bash\n+docker pull sonatype/nexus\n+oc new-app sonatype/nexus\n+```\n+\n+After the build has finished, run:\n+```bash\n+oc get svc\n+```\n+\n+The output should resemble:\n+```bash\n+NAME      CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE\n+nexus     172.30.170.249   <none>        8081/TCP   6s\n+```\n+\n+Confirm that Nexus is running by navigating your browser to the new Cluster-IP\n+at port 8081.  The server may take a bit of time to start, be patient!\n+\n+> NOTE: Nexus comes pre-configured for the Central Repository, but you may need others\n+> for your application.  At this point, add any special repositories to Nexus.\n+\n+Now we'll create a Persistent Volume for Nexus, so that our dependencies will\n+not be lost when the Pod running the server terminates.  If you do not have admin access on your cluster, ask\n+your system administrator to create a Read/Write Persistent Volume for you, and\n+skip to the section on creating Persistent Volume Claim.\n+\n+> NOTE: If you don't want persistent storage, continue to\n+> [Modifying the Builder](#modifying-the-builder). However, your cached\n+> dependencies will be lost with the pod.\n+\n+Create a directory on your host machine that will be writable by OpenShift AND\n+persistent, in case your host machine reboots.\n+```bash\n+mkdir /nexus-pv\n+chmod 777 /nexus-pv\n+```\n+\n+Log in to your admin user, if necessary. Using `oc cluster up`, this is done\n+with:\n+```bash\n+oc login -u system:admin\n+```\n+\n+Create a file called `pv.yaml` with the following content:\n+```yaml\n+---\n+apiVersion: v1\n+kind: PersistentVolume\n+metadata:\n+  name: nexus-pv\n+  labels:\n+    type: local\n+spec:\n+  hostPath:\n+    path: \"/nexus-pv\"\n+  accessModes:\n+  - ReadWriteOnce\n+  capacity:\n+    storage: 1Gi\n+  persistentVolumeReclaimPolicy: Retain\n+```\n+\n+Import that file into OpenShift.\n+```bash\n+oc create -f pv.yaml\n+```\n+\n+Log back in to your user account and add a Persistent Volume Claim to the Nexus\n+Deployment Config.  Using `oc cluster up`, the default user is 'developer'\n+```bash\n+oc login -u developer\n+oc volumes dc/nexus --remove --confirm\n+oc volumes dc/nexus --add \\\n+\t--name 'nexus-pvc' \\\n+\t--type 'pvc' \\\n+\t--mount-path '/sonatype-work/' \\\n+\t--claim-name 'nexus-pv' \\\n+\t--claim-size '1G'\n+```\n+\n+This removes the previous volume for the Deployment Config, and adds a claim\n+for 1 gigabyte of storage mounted at `/sonatype-work`, which is where our\n+dependencies will be stored.  Due to the change in config, the Nexus image will\n+be redeployed automatically.\n+\n+Verify that Nexus is running by refreshing the Nexus page in your browser. You\n+can monitor the builds progress easily using\n+```bash\n+oc get pods -w\n+```\n+\n+## Modifying the Builder\n+\n+The next steps will be modifying our builder image to use this repository.\n+The rest of the tutorial will be editing\n+[this sample repository](https://github.com/bparees/openshift-jee-sample.git),\n+but these changes should work for any project.","path":"docs/maven-tutorial.md","position":122,"original_position":122,"commit_id":"39025c074cf2475e8587167405728e35f884b387","original_commit_id":"39025c074cf2475e8587167405728e35f884b387","user":{"login":"bparees","id":4974046,"avatar_url":"https://avatars.githubusercontent.com/u/4974046?v=3","gravatar_id":"","url":"https://api.github.com/users/bparees","html_url":"https://github.com/bparees","followers_url":"https://api.github.com/users/bparees/followers","following_url":"https://api.github.com/users/bparees/following{/other_user}","gists_url":"https://api.github.com/users/bparees/gists{/gist_id}","starred_url":"https://api.github.com/users/bparees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparees/subscriptions","organizations_url":"https://api.github.com/users/bparees/orgs","repos_url":"https://api.github.com/users/bparees/repos","events_url":"https://api.github.com/users/bparees/events{/privacy}","received_events_url":"https://api.github.com/users/bparees/received_events","type":"User","site_admin":false},"body":"Explaining how to use a maven mirror url in general goes beyond what should be in this tutorial.\r\n\r\nI think it's sufficient to say something like:  Once you've set up a maven mirror, you need to ensure your build process is configured to use it.  When using the openshift eap/tomcat/wildfly images you can accomplish this by setting MAVEN_MIRROR_URL which will automatically modify the default maven settings.xml appropriately.  If you are using your own settings.xml or another image which doesn't do this, see \\<link to maven docs about configuring mirrors in settings.xml\\>\r\n","created_at":"2016-08-26T13:43:17Z","updated_at":"2016-08-26T13:43:17Z","html_url":"https://github.com/openshift/origin/pull/10645#discussion_r76420136","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/10645","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/76420136"},"html":{"href":"https://github.com/openshift/origin/pull/10645#discussion_r76420136"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/10645"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/10645","id":82750376,"html_url":"https://github.com/openshift/origin/pull/10645","diff_url":"https://github.com/openshift/origin/pull/10645.diff","patch_url":"https://github.com/openshift/origin/pull/10645.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/10645","number":10645,"state":"open","locked":false,"title":"Added a tutorial for setting up a Nexus service.","user":{"login":"oatmealraisin","id":6402382,"avatar_url":"https://avatars.githubusercontent.com/u/6402382?v=3","gravatar_id":"","url":"https://api.github.com/users/oatmealraisin","html_url":"https://github.com/oatmealraisin","followers_url":"https://api.github.com/users/oatmealraisin/followers","following_url":"https://api.github.com/users/oatmealraisin/following{/other_user}","gists_url":"https://api.github.com/users/oatmealraisin/gists{/gist_id}","starred_url":"https://api.github.com/users/oatmealraisin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oatmealraisin/subscriptions","organizations_url":"https://api.github.com/users/oatmealraisin/orgs","repos_url":"https://api.github.com/users/oatmealraisin/repos","events_url":"https://api.github.com/users/oatmealraisin/events{/privacy}","received_events_url":"https://api.github.com/users/oatmealraisin/received_events","type":"User","site_admin":false},"body":"The tutorial covers setting up containerized Nexus Repository for Maven\r\ndependency caching.\r\n\r\n@bparees ptal?\r\n\r\n[This is the card for this feature.](https://trello.com/c/X8xapGSH/703-3-document-setting-up-a-local-maven-proxy-evg)","created_at":"2016-08-25T16:19:08Z","updated_at":"2016-08-26T13:43:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"151a45452fb18687f7bdc2622132164ccd7f6d56","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin/pulls/10645/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/10645/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/10645/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/39025c074cf2475e8587167405728e35f884b387","head":{"label":"oatmealraisin:rymurphy/maventutorial","ref":"rymurphy/maventutorial","sha":"39025c074cf2475e8587167405728e35f884b387","user":{"login":"oatmealraisin","id":6402382,"avatar_url":"https://avatars.githubusercontent.com/u/6402382?v=3","gravatar_id":"","url":"https://api.github.com/users/oatmealraisin","html_url":"https://github.com/oatmealraisin","followers_url":"https://api.github.com/users/oatmealraisin/followers","following_url":"https://api.github.com/users/oatmealraisin/following{/other_user}","gists_url":"https://api.github.com/users/oatmealraisin/gists{/gist_id}","starred_url":"https://api.github.com/users/oatmealraisin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oatmealraisin/subscriptions","organizations_url":"https://api.github.com/users/oatmealraisin/orgs","repos_url":"https://api.github.com/users/oatmealraisin/repos","events_url":"https://api.github.com/users/oatmealraisin/events{/privacy}","received_events_url":"https://api.github.com/users/oatmealraisin/received_events","type":"User","site_admin":false},"repo":{"id":60552506,"name":"origin","full_name":"oatmealraisin/origin","owner":{"login":"oatmealraisin","id":6402382,"avatar_url":"https://avatars.githubusercontent.com/u/6402382?v=3","gravatar_id":"","url":"https://api.github.com/users/oatmealraisin","html_url":"https://github.com/oatmealraisin","followers_url":"https://api.github.com/users/oatmealraisin/followers","following_url":"https://api.github.com/users/oatmealraisin/following{/other_user}","gists_url":"https://api.github.com/users/oatmealraisin/gists{/gist_id}","starred_url":"https://api.github.com/users/oatmealraisin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oatmealraisin/subscriptions","organizations_url":"https://api.github.com/users/oatmealraisin/orgs","repos_url":"https://api.github.com/users/oatmealraisin/repos","events_url":"https://api.github.com/users/oatmealraisin/events{/privacy}","received_events_url":"https://api.github.com/users/oatmealraisin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oatmealraisin/origin","description":"OpenShift - Build, deploy, and manage cloud-native and legacy applications with Kubernetes and Docker","fork":true,"url":"https://api.github.com/repos/oatmealraisin/origin","forks_url":"https://api.github.com/repos/oatmealraisin/origin/forks","keys_url":"https://api.github.com/repos/oatmealraisin/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oatmealraisin/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oatmealraisin/origin/teams","hooks_url":"https://api.github.com/repos/oatmealraisin/origin/hooks","issue_events_url":"https://api.github.com/repos/oatmealraisin/origin/issues/events{/number}","events_url":"https://api.github.com/repos/oatmealraisin/origin/events","assignees_url":"https://api.github.com/repos/oatmealraisin/origin/assignees{/user}","branches_url":"https://api.github.com/repos/oatmealraisin/origin/branches{/branch}","tags_url":"https://api.github.com/repos/oatmealraisin/origin/tags","blobs_url":"https://api.github.com/repos/oatmealraisin/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oatmealraisin/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oatmealraisin/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/oatmealraisin/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oatmealraisin/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/oatmealraisin/origin/languages","stargazers_url":"https://api.github.com/repos/oatmealraisin/origin/stargazers","contributors_url":"https://api.github.com/repos/oatmealraisin/origin/contributors","subscribers_url":"https://api.github.com/repos/oatmealraisin/origin/subscribers","subscription_url":"https://api.github.com/repos/oatmealraisin/origin/subscription","commits_url":"https://api.github.com/repos/oatmealraisin/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/oatmealraisin/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/oatmealraisin/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/oatmealraisin/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/oatmealraisin/origin/contents/{+path}","compare_url":"https://api.github.com/repos/oatmealraisin/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oatmealraisin/origin/merges","archive_url":"https://api.github.com/repos/oatmealraisin/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oatmealraisin/origin/downloads","issues_url":"https://api.github.com/repos/oatmealraisin/origin/issues{/number}","pulls_url":"https://api.github.com/repos/oatmealraisin/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/oatmealraisin/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/oatmealraisin/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oatmealraisin/origin/labels{/name}","releases_url":"https://api.github.com/repos/oatmealraisin/origin/releases{/id}","deployments_url":"https://api.github.com/repos/oatmealraisin/origin/deployments","created_at":"2016-06-06T18:47:57Z","updated_at":"2016-06-06T18:48:05Z","pushed_at":"2016-08-25T20:28:20Z","git_url":"git://github.com/oatmealraisin/origin.git","ssh_url":"git@github.com:oatmealraisin/origin.git","clone_url":"https://github.com/oatmealraisin/origin.git","svn_url":"https://github.com/oatmealraisin/origin","homepage":"http://www.openshift.org","size":319760,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"f0341272e4f503edb88ae5e7cee43992ee945056","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":22442668,"name":"origin","full_name":"openshift/origin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin","description":"Enterprise-Ready Kubernetes for Developers","fork":false,"url":"https://api.github.com/repos/openshift/origin","forks_url":"https://api.github.com/repos/openshift/origin/forks","keys_url":"https://api.github.com/repos/openshift/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin/teams","hooks_url":"https://api.github.com/repos/openshift/origin/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin/events","assignees_url":"https://api.github.com/repos/openshift/origin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin/tags","blobs_url":"https://api.github.com/repos/openshift/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin/languages","stargazers_url":"https://api.github.com/repos/openshift/origin/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin/subscription","commits_url":"https://api.github.com/repos/openshift/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin/merges","archive_url":"https://api.github.com/repos/openshift/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin/downloads","issues_url":"https://api.github.com/repos/openshift/origin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/origin/deployments","created_at":"2014-07-30T20:04:05Z","updated_at":"2016-08-26T12:05:11Z","pushed_at":"2016-08-26T13:23:50Z","git_url":"git://github.com/openshift/origin.git","ssh_url":"git@github.com:openshift/origin.git","clone_url":"https://github.com/openshift/origin.git","svn_url":"https://github.com/openshift/origin","homepage":"http://www.openshift.org","size":576349,"stargazers_count":1632,"watchers_count":1632,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1030,"mirror_url":null,"open_issues_count":1092,"forks":1030,"open_issues":1092,"watchers":1632,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/10645"},"html":{"href":"https://github.com/openshift/origin/pull/10645"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/10645"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/10645/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/10645/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/10645/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/39025c074cf2475e8587167405728e35f884b387"}}}}
{"actor":{"display_login":"bparees"}}