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
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
<img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e3RvY30&locale=en_GB&version=2" data-macro-name="toc"> <h1>Notes</h1> <p><strong>NOTE:</strong> <em>This page contains drafts of user contributed FAQ entries. The content you see here might not be fully fool-proof or might not comply with the best practices promoted by Maven. What is only guaranteed is that they have worked once for some members. It is best to treat these items as "works in progress" until they have been reviewed and promoted to the main Maven documentation site.</em></p> <p>Users may also list questions here that they would like answered. So this page can serve as a collection of questions that users would like answered. Please put unanswered questions at the bottom. Please follow the format that is being used because it will help in our automated exaction of material which can then be incorporated into the main site.</p> <h1>Answered Questions</h1> <h2>How do I resolve the "<plugin name> does not exist or no valid version" error?</h2> <p>This means that Maven is unable to access the required plugin from your local repository, and unable to access the official or 'central' Maven2 plugin repository.</p> <p>You may troubleshoot the problem by performing the following actions:</p> <ol> <li>If you are behind a http proxy, please check the Maven2 <a href="http://maven.apache.org/guides/mini/guide-proxies.html">proxy settings guide</a>.</li> <li>Try running with -U - this will force an update check on all plugins. This is often necessary if upgrading Maven from a pre-beta release.</li> </ol> <p>If the problem still persists you may seek help from the Maven user list, browse <a href="http://www.mail-archive.com/users@maven.apache.org/">archived discussions</a>, or log a <a href="http://jira.codehaus.org/browse/MNG">ticket</a> describing your problem if you think you have found a bug. Tickets could also be issued for feature enhancement requests, and other tasks.</p> <h2>How do I install a file in my local repository along with a generic POM?</h2> <p>This solution requires at least 2.0.1-SNAPSHOT or above version of Maven 2. You may do this by typing this command (please take note that this is a single line only).</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> mvn install:install-file -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dfile=<path-to-file> -Dpackaging=<packaging> (i.e. jar) -DgeneratePom=true </pre></td></tr></table> <p> </p> <p> </p> <p>This command installs the jar in your local repository with the generated generic pom.</p> <h3>How do I install a file in my local repository along with my customized POM?</h3> <p>The solution requires at least 2.0.1-SNAPSHOT or above version of Maven 2 and add the -DpomFile=<path-to-pom> parameter just like the sample below.</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> mvn install:install-file -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dfile=<path-to-file> -Dpackaging=<packaging> (i.e. jar) -DpomFile=<path-to-pom> </pre></td></tr></table> <p> </p> <p> </p> <p>This command will install the file in your local repository along with your customed pom.</p> <h3>How do I include/exclude the other modules in the navigation menu in the parent site?</h3> <p><a href="http://jira.codehaus.org/browse/MNG-661">http://jira.codehaus.org/browse/MNG-661</a>, provides a simple patch which provides parent and module links using the project URLs which as you<br /> correctly point out only work when the site is deployed.</p> <h3>Where is the other plugin?</h3> <p>If you cannot find a certain plugin, you may want to take a look on the following sites.</p> <ol> <li><a href="http://mojo.codehaus.org">http://mojo.codehaus.org</a></li> <li><a href="https://svn.codehaus.org/mojo/trunk/mojo">https://svn.codehaus.org/mojo/trunk/mojo</a></li> <li><a href="https://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox">https://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox</a></li> </ol> <h3>Does Maven 2.x support pre/postGoals?</h3> <p>Maven 2.x no longer supports pre/postGoals, which were used in Maven 1.x to inject custom behavior to the build process. This caused a problem, since declaring your code to be a preGoal of some other goal meant that you depended on that specific goal, rather than the work it did. It also caused confusion when trying to inject other behavior into a build that already had pre/postGoals attached: Where would the new behavior be injected?</p> <p>Pre- and post-goals in Maven 1.x were usually used to develop the concept of a workflow, or lifecycle, for the build, where <strong>x</strong> happened before <strong>y</strong>, which had to happen before the sources could be compiled. In Maven 2, we've incorporated this concept of a build lifecycle natively. The steps - or phases - in this lifecycle correspond to the types of actions that might occur in a build. Your plugin can declare which type of action it performs - or which phase it should bind to - and that will guarantee it is executed before the next action type. For example, if your plugin generates some source code, you might want it to bind to the "generate-sources" lifecycle phase, so it is guaranteed to run before the "compile" phase.</p> <p>For more information, see:</p> <ul> <li><a href="http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html">Introduction to the Build Lifecycle</a></li> </ul> <h3>What is the difference between Maven and Ivy?</h3> <p>For a comparison of Maven's features vs Ivy's you can refer to our <a href="http://docs.codehaus.org/display/MAVEN/Feature+Comparisons">feature comparison</a></p> <h3>How do I get a plug-in's dependencies from a Mojo?</h3> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> public class MyMojo extends AbstractMojo { /** * @parameter expression="${plugin.artifacts}" * @required */ private List pluginArtifacts; public void execute() throws MojoExecutionException { ... for ( Iterator i = pluginArtifacts.iterator(); i.hasNext(); ) { Artifact pluginArtifact = (Artifact) i.next(); } ... } } </pre></td></tr></table> <p> </p> <p> </p> <h3>How do I get the project's sources from a Mojo?</h3> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> public class MyMojo extends AbstractMojo { /** * @parameter expression="${project.compileSourceRoots}" * @required */ private List sourceRoots; public void execute() throws MojoExecutionException { ... for ( Iterator i = sourceRoots.iterator(); i.hasNext(); ) { String sourceRoot = (String) i.next(); // Do what you want with these directories } } } </pre></td></tr></table> <p> </p> <p> </p> <h3>Does the v4.0.0 POM include a <versions/> element?</h3> <p>The POM is meant to be current state, not history. We actually only record the versions in the repository, and if the SCM tag is populated in the <scm> section of the POM for each released version you can reconstruct the information.</p> <p>There were other issues with putting history in the POM: forgetting to add it, getting the right level of information when you work on multiple branches, and similar things.</p> <h3>How do I create a report that does not require Doxia's Sink interface?</h3> <p>Make it a report and override the isExternalReport() method to return true. Then you don't need to use the Sink at all.</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