provided depedencies and Maven best practices ...

2010-04-26 Thread Kedar Mhaswade

The Maven books at sonatype.org suggest that while employing Maven to do
multi module builds, it is better to carefully segregate your dependencies
in a separate module whose packaging type is pom and then depend on this
module with pom.

I followed that advice and now I have the following:


  mygroup
  our-dependencies
  ${project.version}
  pom


declared in my web-app's pom.xml. The idea being all the dependencies there
are depended on by this web-app module.  One of the dependencies declared at
this common place (our-dependencies) is the servlet-api which should be
declared a "provided" dependency:


  javax.servlet
  servlet-api
  2.5
  provided

 
The trouble is that with this dependency, my web-app fails to compile since
it can't find the servlet-api classes and interfaces. The only work-around
is that in my web-app, the servlet-api dependency has to be re-declared.

Is this a bug or a feature? Alternatively, is the best practice in such
cases to explicitly declare "provided" dependencies where they are actually
needed rather than grouping them as "our-dependencies"?

Thank you, in advance.
-- 
View this message in context: 
http://maven-users.828.n2.nabble.com/provided-depedencies-and-Maven-best-practices-tp4964099p4964099.html
Sent from the maven users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Inheritance hierachy of a Maven project ...

2010-04-03 Thread Kedar Mhaswade

My search returned nothing, hence the post. Hopefully, this is a simple
question.

Is it reasonable to expect mvn help:effective-pom to return the hierarchy of
a POM (e.g. project-a -> parent-a -> parent-b -> super-POM)? It does not
seem to be doing it as of 2.2.1. Is there another way to know the
inheritance hierarchy of a project?

Thanks!
-- 
View this message in context: 
http://n2.nabble.com/Inheritance-hierachy-of-a-Maven-project-tp4848549p4848549.html
Sent from the maven users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



mvn install:help and mvn help:describe for install plugin are at odds ...

2010-03-24 Thread Kedar Mhaswade

Is this a bug?

mvn help:describe goal suggests that standard maven install plugin has three
goals: install:help, install:install and install:install-file. On doing mvn
install:help however, maven says there is no such goal!

Here is the entire interaction:
vp2c01a-dhcp147:example kedar$ mvn -v
Apache Maven 2.2.1 (r801777; 2009-08-06 12:16:01-0700)
Java version: 1.6.0_17
Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.6.3" arch: "x86_64" Family: "mac"
vp2c01a-dhcp147:example kedar$ mvn help:describe
-Dplugin=org.apache.maven.plugins:maven-install-plugin
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'help'.
[INFO]

[INFO] Building example
[INFO]task-segment: [help:describe] (aggregator-style)
[INFO]

[INFO] [help:describe {execution: default-cli}]
[INFO] org.apache.maven.plugins:maven-install-plugin:2.3

Name: Maven Install Plugin
Description: Copies the project artifacts to the user's local repository.
Group Id: org.apache.maven.plugins
Artifact Id: maven-install-plugin
Version: 2.3
Goal Prefix: install

This plugin has 3 goals:

install:help
  Description: Display help information on maven-install-plugin.
Call
 mvn install:help -Ddetail=true -Dgoal=
to display parameter details.
  Deprecated. No reason given

install:install
  Description: Installs the project's main artifact in the local repository.
  Deprecated. No reason given

install:install-file
  Description: Installs a file in the local repository.
  Deprecated. No reason given

For more information, run 'mvn help:describe [...] -Ddetail'

[INFO]

[INFO] BUILD SUCCESSFUL
[INFO]

[INFO] Total time: 1 second
[INFO] Finished at: Wed Mar 24 16:52:58 PDT 2010
[INFO] Final Memory: 10M/79M
[INFO]

vp2c01a-dhcp147:example kedar$ mvn install:help
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO]

[ERROR] BUILD FAILURE
[INFO]

[INFO] Required goal not found: install:help in
org.apache.maven.plugins:maven-install-plugin:2.2
[INFO]

[INFO] For more information, run Maven with the -e switch
[INFO]

[INFO] Total time: < 1 second
[INFO] Finished at: Wed Mar 24 16:53:07 PDT 2010
[INFO] Final Memory: 3M/79M
[INFO]



Thank you!

-Kedar
-- 
View this message in context: 
http://n2.nabble.com/mvn-install-help-and-mvn-help-describe-for-install-plugin-are-at-odds-tp4794693p4794693.html
Sent from the maven users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: which artifact comes from where?

2008-04-19 Thread Kedar Mhaswade

Hi Brett,

Thanks for your response. I agree, I could request for an enhancement
where local repo remembers where a particular artifact came from. I will
log an RFE for the same.

But I think I am asking for a shorthand command to do a re-resolution
if that's what this entails. Maven already does it, when I do for instance,
"mvn [-U] install". Here, I just want something like:

mvn resolve -DgroupId=javax.persistence -DartifactId=persistence-api -Dversion= 
...

and it tells me it resolved it from a particular remote repository without
even consulting local repo. So, I guess this is letting users know where
artifact resolves from, without actually installing it in local repo.

The reason I ask for this is sometimes, a local repo has gone bad or corrupt
and I want to delete it. Then, after finding out the repo from above command,
I can use it in mvn install:install-file to reinstall it locally.

- Kedar

Brett Porter wrote:

Once Maven has resolved an artifact, the local repository does not
remember where it came from, so it would not be possible to do this
reliably (without re-resolving them all, which would essentially just
be doing this in order).

You could make a feature request for Maven to remember this in the
local repository.

Another alternative is to use a repository manager. You can then proxy
in all the remote repositories (as well as getting a number of other
benefits like being able to block out certain artifacts or
repositories), and Maven can get them all from there. It is easier to
search for a given artifact's source repository in this case (or you
may no longer need to do so, depending on your reason now).

- Brett

On 20/04/2008, Kedar Mhaswade <[EMAIL PROTECTED]> wrote:

Is there a shorthand command (e.g. mvn resolve or something similar)
 that tells me which repository a particular artifact comes from,
 when a large project has several repositories?

 Thanks,
 Kedar

 (Currently, I look at all the repositories (http://...) and
 find that out -- this seems quite time-consuming).

-
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



which artifact comes from where?

2008-04-19 Thread Kedar Mhaswade

Is there a shorthand command (e.g. mvn resolve or something similar)
that tells me which repository a particular artifact comes from,
when a large project has several repositories?

Thanks,
Kedar

(Currently, I look at all the repositories (http://...) and
find that out -- this seems quite time-consuming).

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Fixing not finding "maven-resources-plugin"

2008-03-29 Thread Kedar Mhaswade

Karr, David wrote:

I know very little about maven2.  I'm trying to step through a Struts2
tutorial (Ian Roughley's book).

After executing the following:

mvn archetype:create -DgroupId=com.fdar.apress.s2
-DartifactId=struts2-starter -DarchetypeGroupId=org.apache.struts
-DarchetypeArtifactId=struts2-archetype-starter
-DarchetypeVersion=2.0.9-SNAPSHOT
-DremoteRepositories=http://people.apache.org/maven-snapshot-repository

I then did "mvn jetty:run", and it said:

The plugin 'org.apache.maven.plugins:maven-resources-plugin'
does not exist or no valid version could be found

What would be the correct way to resolve this?  Could the original
command-line have been amended to avoid this in the first place?


Can you try mvn -U jetty:run instead?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



javadoc for maven API ...

2008-02-15 Thread Kedar Mhaswade

Pardon me if this is already available elsewhere, but the API

http://maven.apache.org/ref/2.0.7/maven-project/apidocs/

does not cross-link with API's from maven-model, maven-monitor.

E.g. MavenProject.getBuild() has:

 org.apache.maven.model.Build   getBuild()

where  org.apache.maven.model.Build is not linked to the Build class from
maven-model apidocs.

What can I do to improve navigability of the maven javadoc?

Thanks,
Kedar

PS - In general, we can (should?) improve the quality of the apidocs, but
that's a topic for another day.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]