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

Robert Munteanu commented on FELIX-3358:
----------------------------------------

The attached patch is a proof-of-concept implementation, not yet fully polished.

I've adapted the current MavenLog to use the BuildContext whenever an error is 
reported with a partial or complete source location. This works in the 
following manner:

*CLI*

The error/warning is logged with a specific format, e.g.

{code}
[WARNING] 
/home/rmuntean/w/workspace/bundle-sample/src/main/java/rmuntean/bundle_sample/ComplexDSComponent.java
 [0:0]: @Component : Lifecycle method deactivate has wrong number of arguments
{code}

*Eclipse*

A marker is attached to the file. However, since I don't have any source 
information ( line number and column number would be ideal ) the errors are not 
flagged in the editor, but only visible in the Erorrs/Markers view.

I've started adding this lineNumber/columnNumber information to the scrplugin, 
but I've stopped for two reasons:

1. I think it's best to add a SourceLocation class to the project to 
encapsulate the (file, line, column) information.
2. I realised I need to modify the ASM processing in order to get the 
information, which I didn't have enough time to.

All in all, this works right now, with the single caveat that markers are not 
deleted on incremental builds in Eclipse. But that will probably come when we 
will make full use of the BuildContext.
                
> Enhance the maven-scr-plugin to be compatible with recent Maven/Eclipse 
> integrations
> ------------------------------------------------------------------------------------
>
>                 Key: FELIX-3358
>                 URL: https://issues.apache.org/jira/browse/FELIX-3358
>             Project: Felix
>          Issue Type: Improvement
>          Components: Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.8.0
>         Environment: Eclipse Indigo or newer
>            Reporter: Robert Munteanu
>             Fix For: maven-scr-plugin-1.8.2
>
>         Attachments: FELIX-3358-BuildContext-message-reporting.txt, 
> FELIX-3358-BuildContext-message-reporting.txt, m2e-lifecycle-mapping.diff
>
>
> With the recent changes brought to the Maven Eclipse integration, any unknown 
> [0] plugins are flagged as problematic and an error is reported in the 
> pom.xml . Typically this is solved by writing a thin integration layer 
> between the Eclipse integration and the Maven plugin [1]  or by instructing 
> Eclipse to ignore some plugin executions.
> The new 1.1 version of the m2eclipse plugin will allow a Maven plugin ( with 
> no links to Eclipse plugin development ) to use an enhanced API to become 
> compatible out of the box with the Eclipse integration [2] .
> The maven-scr-plugin should take advantage of these new APIs to allow 
> seamless integration with Eclipse.
> [0]: http://wiki.eclipse.org/M2E_plugin_execution_not_covered
> [1]: http://wiki.eclipse.org/M2E/Extension_Development
> [2]: http://wiki.eclipse.org/M2E_compatible_maven_plugins

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to