Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 187 Next »

NOTE: 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.

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.

Answered Questions (Index)

Previously answered questions can be found here.

Unanswered Questions

How to replace "attainGoal" in maven 1 with plugin in maven 2?

I would like to write up a plugin that have multiple goals. Does anyone have some samples that can share? Basically, a sample goal that compiles the source and another one that packages it as a WAR would be sufficient. Please help and thanks in advance

The way to 'call goals' in maven 2 is using plugin. I think what you should do is write a plugin that comprises of other plugins (goals) that you wish to call with their respective phase. So when you call this plugin (say during compile phase), it in turn will call your 'configured plugins' to do their work. This has the same effect of specifying multiple goals.

I believe one can do the same thing without writing a plugin for it but if your requirements demand it, yes you can do it that way. For example I wrote a maven 2 plugin (boiler plate code generator) that uses jaxme plugin with some additional processing. I did sort of the same thing. This 'MyPlugin' used jaxme plugin & did some more operation as part of it's 'phase'.

 Why TaglibPlugin don't add inherited attributes to my TLD ?

 I'm using org.xdoclet.plugin.web.TaglibPlugin to generate TLD from my Tag library but inherited attributes are not generated. What should I do ?

XDoclet can only scan source files, so the parent class' source should be available to the plugin. Assuming
the parent class is in a different module, add a dependency for the source artifact to the plugin definition in the build section.


Where can I find a listing of the available variable references that could be use during site generation?

How do I run a shell script from inside a Mojo?

See http://mojo.codehaus.org/exec-maven-plugin/exec-mojo.html

Will the release plug-in resolve all my SNAPSHOT dependencies?

No, it will check if there are still any SNAPSHOT dependencies there and won't proceed if there are. You
will have to manually choose a stable (released) version before you can release.

How to copy files from local repo to remote repository?

You should use deploy plugin. This plugin will also create SHA1 & MD5 files needed for checksum. 

Where should sql, dtds, test data and generated docs go?

Is there a way for plugin goals to be aware of the phase they are being executed on?

When you have a project using a code generator plugin, how can we add the generated sources in the list of eclipse source directory?

How do I tell maven which version of ant I want it to call?

How do I display special characters (i.e. copyright symbol, latin-1) with APT?

This is already covered in the APT mini-guide. http://maven.apache.org/guides/mini/guide-apt-format.html


 I have an issue with my user.home directoy have either a space or special character ie. C:\Documents and Settings\myname & someothername. This causes an org.codehaus.plexus.util.xml.pull.XmlPullParserException: entity reference names can not start with character ' ' (position: START_TAG seen ...<extendC:\Documents and Settings\myname & ... @2:44) error. Does anyone have an idea how to fix this without creating a new Windows account <read major pain> Thanks

 How do I call another Mojo (in a different plugin) from my Mojo?

Specific [Unanswered] Errors - Need more information

I've got my plugin pom setup to build everything and construct the final zip file. The issue I'm trying to wrap my brain around is keeping my feature.xml and site.xml files up to date with the correct version info. Since I can't use versions like 1.0.0-SNAPSHOT in my plugin, I have to munge the plugins pom version into something like 1.0.0.v${DATETIME} and insert that into the plugins descriptor (plugin.xml). Since the version in the plugin.xml changes I have to update the plugin entries in the feature descriptor (feature.xml), rev the feature and update the site.xml with the new feature version. Just curious to see if anyone else out there is struggling with these same issues and what if any solutions/band-aids have been implemented

jdcasey

This is more of a user-list type of question. It's going to be an in-depth discussion about designing and/or configuring a suite of plugins for a very specific purpose. This probably isn't a Frequently Asked Question.


Why the FTP Wagon hangs?

jdcasey

Need more information on this. Under what circumstances does this happen? Can the user access the server in another FTP client? Is there a stack trace associated? Do they have a corresponding <server/> section in the settings.xml?


When I run the release:prepare goal I get an authorization failed error. I tried adding the username and password into my pom.xml file and I still get the error. I checked using the command line and my username and password is being cached by subversion. Any ideas?

jdcasey

This is the entry point for a debugging discussion. From here, the user may need to verify that they have the 'svn' command in their path, and that Maven is trying to use subversion with the same username that the user has verified by hand. After that, it depends.


Why am I getting this error when I build my project: "Unable to locate the Javac Compiler"?

jdcasey

We would need to get more information about this user's POM and environment (output of the build would be most valuable) in order to effectively answer this question. Without this context, it is unanswerable.


Why do I get java.lang.NullPointerException while trying to generate site for a project?

jdcasey

Even a simple stacktrace for this user's error would help immensely in debugging this problem. Without specifics, any higher analysis is virtually impossible.


kenney

Probable cause: no <url> in the pom. The NPE is fixed long ago.


How to make archetype where project artifacts have names based on artifactId?

How can I create an archetype where one of the archetype-resource files should be created with a name based on the artifactId? For instance, if I ask to create a new project based on my archetype with -DartifactId=foobar, then I'd like a foobar-stuff.xml file to appear in the project. I know that I can use $

Unknown macro: {artifactId}


within files, but how can I do the same thing with filename?
 

How can I add two different source-directories to a project?

Compilation of dependencies in a project

Is there any solution that could be used to compile my dependencies (building the jars to bring it up-to-date) when I generate my webapplication?
Arnault

How do I get a list of all available properties?

How do I get a list of all available properties? I already found a static list (http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide), but there should be a way to create a list of all available properties and their values during the build , e.g. by using a Properties-Plugin.

  • No labels