Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Maven User
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<p>Working at an IT development-company it has many advantages to proxy the official repositories, but some projects will not be worked on anymore or are transfered to another company. What to do? Explain everything in big documents and refer to this wiki? No, one wants to project just to work. Nobody can guarantee the future releases of Maven won't break your project. And another wish: if somebody just wants to check out if the project is good to be used, it does not want to take a day for it.</p> <h1>Finding a good location</h1> <p>The biggest pain is to get the repositories at a specific place, so it is isolated, i.e. in the project-tree. I chose "project/tools/maven-2.x.x" to have the complete Maven in. So the most logical location would be "project/tools/maven-2.x.x/repository". So I copy a fresh install of the used Maven into the tools-dir.</p> <h1>Edit settings.xml</h1> <p>In project/tools/maven-2.x.x/config you'll find settings.xml which needs to be updated to have the current repository-location in it. Just before "</settings>" we put</p> <table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> <localRepository>file://${MVN_HOME}/repository</localRepository> </pre></td></tr></table> <p>This works, because config.xml reads environment-variables. If you found this page, you might have tried i.e. ${project.basedir} and have noted it is not set. <br class="atl-forced-newline" /></p> <h1>Edit pom.xml</h1> <p>The POM should be updated to use the local repository:</p> <table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="xml" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6eG1sfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> <repositories> <repository> <id>local</id> <name>Local</name> <url>file://${project.basedir}/toolss/maven-2.0.9/repository</url> </repository> </repositories> </pre></td></tr></table> <h2>Make it work out of the box</h2> <p>I always provide two files:</p> <ul> <li>readme.txt : contains project-description, autors, history and how to get the project up-and-running fast ("mvn eclipse:eclipse" and that kind of things).</li> <li>build.bat / build.sh : this should take care of everything to build the project. Optional: JAVA_HOME should be edited to point to a JDK, since I do not like to add a complete JDK into the tools-dir and assume a Java-developer has it installed on his machine. I just do a check if "JAVA_HOME" is set. When the customer wants a source-CD, I make an exception.</li> </ul> <p>Other developers will understand what these files wil do and probably just run "build" without reading the . Understand and remember that people only want to put time in a project, when they think it's worth it. So make your script user-friendly and the txt very short, so it gives you a chance to try again.</p> <p>The build-script sets the JAVA_HOME (I use "rem set JAVA_HOME=<my own location>" or "# export JAVA_HOME=<my own location>" to give a hint) and MVN_HOME (should point to "%CD%/project/tools/maven-2.x.x" or "`pwd`/project/tools/maven-2.x.x") and calls /project/tools/maven-2.x.x/bin/mvn.bat or /project/tools/maven-2.x.x/bin/mvn.sh to build the project giving the developers-build of the project. Afterwards it show which Java-version it used and which maven-location was used, so the user has feedback when the build fails.</p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced