You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "John Casey (JIRA)" <ji...@codehaus.org> on 2005/09/13 23:42:03 UTC

[jira] Commented: (MNG-697) allow plugins to declare dependence on the project-classpath(s)

    [ http://jira.codehaus.org/browse/MNG-697?page=comments#action_46328 ] 

John Casey commented on MNG-697:
--------------------------------

Just started adding this, and I'm starting to see that this will be pretty clunky to implement. First of all, at the point where we're building up the plugin container, we don't know which mojos will be executed from that container (we could assume that they all will, but...). This means several things:

1. we can't tell whether that mojo is an aggregator, and we need iterate over the reactorProjects, pulling classpath from each

2. we may wind up putting together a test-scoped classpath for one mojo, but another from the same plugin may expect that test-scope deps are NOT in the classpath...this can be mitigated by declaring the addedProjectClasspath="scope" at the plugin level, but #1 still remains.

I'm not sure that the complexity for this implementation is justified, when we can simply create a classloader using existing parameter expression results.

> allow plugins to declare dependence on the project-classpath(s)
> ---------------------------------------------------------------
>
>          Key: MNG-697
>          URL: http://jira.codehaus.org/browse/MNG-697
>      Project: Maven 2
>         Type: New Feature
>   Components: maven-plugin-descriptor, maven-core
>     Versions: 2.0-alpha-3
>     Reporter: John Casey
>     Assignee: John Casey
>     Priority: Critical
>      Fix For: 2.0-beta-2

>
> Original Estimate: 3 hours
>         Remaining: 3 hours
>
> Currently the only way to provide access to the classpath which consists of the project artifacts within some scope from a plugin is to manually create your own classloader inside the plugin using project.getCompileClasspath() or somesuch. In many plugins (thinking of integration-tests where the project is NOT an appserver module), it would be most useful to have the plugin container started with the appropriate project-classpath already added to the container. This might even be nice for testing plexus projects, and would allow the plugin to simply instantiate (somehow) and use compiled classes in order to run tests.
> Jesse even tells me this would be useful from a process-classes phase, in order to gather info about the classes that were compiled.
> I propose the following modifications:
> 1. Add addProjectClasspath="scope" (where scope = {compile,test...}) configuration for the maven-plugin-plugin, alongside prefix or whatever else we use to define the plugin-level metadata.
> 2. For plugins declaring addProjectClasspath, add the appropriate project classpath to the plugin container before calling the mojo.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org