maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mirko Friedenhagen (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (MNG-5805) Custom packaging types: configuring DefaultLifecycleMapping mojo executions
Date Sun, 19 Jul 2015 20:37:04 GMT

    [ https://issues.apache.org/jira/browse/MNG-5805?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14632918#comment-14632918
] 

Mirko Friedenhagen edited comment on MNG-5805 at 7/19/15 8:36 PM:
------------------------------------------------------------------

Unfortunately this breaks enforcers' requirePluginVersions rule as the later one relies on
getting the phase as a String.

{code}
Caused by: java.lang.ClassCastException: org.apache.maven.lifecycle.mapping.LifecyclePhase
cannot be cast to java.lang.String
    at org.apache.maven.plugins.enforcer.RequirePluginVersions.getAllPlugins(RequirePluginVersions.java:739)
    at org.apache.maven.plugins.enforcer.RequirePluginVersions.getBoundPlugins(RequirePluginVersions.java:606)
    at org.apache.maven.plugins.enforcer.RequirePluginVersions.execute(RequirePluginVersions.java:232)
    at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:150)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
{code}


was (Author: mfriedenhagen):
Unfortunately this breaks enforcers' requirePluginVersions rule as the later one relies on
getting the phase as a String.

> Custom packaging types: configuring DefaultLifecycleMapping mojo executions
> ---------------------------------------------------------------------------
>
>                 Key: MNG-5805
>                 URL: https://issues.apache.org/jira/browse/MNG-5805
>             Project: Maven
>          Issue Type: Improvement
>          Components: Plugins and Lifecycle
>            Reporter: Anton Tanasenko
>            Assignee: Jason van Zyl
>            Priority: Minor
>             Fix For: 3.3.4
>
>
> Currently, DefaultLifecycleMapping does not support mapping phases to goals with a custom
configuration (see maven-core/src/main/resources/META-INF/plexus/default-bindings.xml). It
is impossible to bind, say, an assembly plugin to 'package' phase within a custom packaging
type, since assembly plugin requires a meaningful configuration to be set.
> At my job, we have a number of poms, each serving a purpose of defining a lifecycle for
a particular type of project (there's one for jar, a couple for wars and several more for
other types of deployable artifacts).
> Now that I somewhat understand maven's lifecycle, It seems natural to convert such poms
to custom packaging types, leaving only a single parent with global config and pluginManagement.
But it is currently impossible, since we are using mostly standard plugins (only occasional
dedicated ones) to configure projects' lifecycles.
> I did some digging around and put together a relatively straightforward change to maven-core:
https://github.com/apache/maven/compare/master...atanasenko:mng-5805-lifecycle-mojo-config?w=1
> It both introduces support for specifying configuration and dependencies for mojo executions:
> {code:xml}
> <install>
>   <mojos>
>     <mojo>
>       <goal>org.apache.maven.plugins:maven-install-plugin:2.4:install</goal>
>       <configuration>...</configuration>
>       <dependencies>...</dependencies>
>     </mojo>
>     <mojo>
>       ...
>     </mojo>
>   </mojos>
> </install>
> {code}
> as well as retains support for existing mapping syntax:
> {code:xml}
> <install>org.apache.maven.plugins:maven-install-plugin:2.4:install, ...</install>
> {code}
> I will put together some its (as well as make sure that existing are running ok) and
create a pull request for both. Also, there are a couple of changes that break API in org/apache/maven/lifecycle/Lifecycle.java
and org/apache/maven/lifecycle/mapping/Lifecycle.java. How critical is it to mantain compatibility
in those two?
> ITS: https://github.com/apache/maven-integration-testing/compare/master...atanasenko:mng-5805-lifecycle-mojo-config?w=1



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message