Home » Archived » Maven Integration (M2E) » How to add Eclipse marker on file when Maven build failed ?
How to add Eclipse marker on file when Maven build failed ? [message #11572] |
Sat, 19 July 2008 18:45  |
Eclipse User |
|
|
|
I am working on a MOJO (similar to XSLT Maven Plugin).
I want to add a marker (visible on Eclipse "Problems" view) on files which
have a XSL Transformation problem.
Those files are included on a Eclipse project with a Maven builder M2E
attached on it.
Is the M2E plugin can help me for this need ?
|
|
| | | |
Re: How to add Eclipse marker on file when Maven build failed ? [message #11874 is a reply to message #11660] |
Mon, 21 July 2008 20:36   |
Eclipse User |
|
|
|
JY wrote:
> Here an Eclipse 3.4 (with m2Eclipse 0.9.5.20080717-1819) project which
> uses the regular XSLT MOJO from :
> http://mojo.codehaus.org/xslt-maven-plugin/
I needed some time to investigate this. Sorry about delay.
> In this Eclipse project, XSLT Mojo is bound to process-resources phase
> in pom.xml
>
> I have inserted an XPath error in the XSL file
> (src/main/teplate/xsl/main.xsl line 7)
>
> No marker in "Problems" view, while an exception is thrown in the
> Eclipse "Console" view :
If you do it like this, more specifically, using Maven launch
configuration, we can't add error markers for the failed builds because
that build is running in a separate JVM. We may consider to have an
option to run those in-process, but it is not available right now (also
note that in-process Maven runtime will have to be Maven 2.1 level, same
as Embedded, and it have some incompatibilities with Maven 2.0).
However, what I was referring in my previous message is that you can
specify additional goals to execute or bind your plugin to
process-resources build phase which is executed by default. See
http://docs.codehaus.org/display/M2ECLIPSE/Dependency+Manage ment
For example, you can enable that in your pom.xml using something like
this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xslt-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>transform</goal>
</goals>
</execution>
</executions>
Then your plugin will be executed in-process on resource change or on
project clean and if there is any errors during execution those errors
will be shown in the Problems view.
I've verified that plugin is executed properly, however there are
couple things that are getting into the way.
First of all, m2eclipse is currently not monitoring resources and rely
on other plugins, such as JDT. So, you will need to use Project /
Clean... to force build manually.
For some reason, xslt plugin errors are being ignored and does not
appear in the Problems view. This look like a bug and it need to be
investigated. If you are interested in this feature, please open a JIRA
issue in the project tracker at
http://jira.codehaus.org/browse/MNGECLIPSE and link to this thread or
attach your test project up there.
Thanks
Eugene
|
|
|
Re: How to add Eclipse marker on file when Maven build failed ? [message #13605 is a reply to message #11874] |
Wed, 30 July 2008 11:45   |
Eclipse User |
|
|
|
Have you got a Eclipse sample project correctly configured where this
feature is working properly?
Because even with your explanations, I can not make it work! :(
Eugene Kuleshov wrote:
> JY wrote:
>> Here an Eclipse 3.4 (with m2Eclipse 0.9.5.20080717-1819) project
>> which uses the regular XSLT MOJO from :
>> http://mojo.codehaus.org/xslt-maven-plugin/
> I needed some time to investigate this. Sorry about delay.
>
>> In this Eclipse project, XSLT Mojo is bound to process-resources
>> phase in pom.xml
>>
>> I have inserted an XPath error in the XSL file
>> (src/main/teplate/xsl/main.xsl line 7)
>>
>> No marker in "Problems" view, while an exception is thrown in the
>> Eclipse "Console" view :
> If you do it like this, more specifically, using Maven launch
> configuration, we can't add error markers for the failed builds
> because that build is running in a separate JVM. We may consider to
> have an option to run those in-process, but it is not available right
> now (also note that in-process Maven runtime will have to be Maven 2.1
> level, same as Embedded, and it have some incompatibilities with Maven
> 2.0).
>
> However, what I was referring in my previous message is that you can
> specify additional goals to execute or bind your plugin to
> process-resources build phase which is executed by default. See
> http://docs.codehaus.org/display/M2ECLIPSE/Dependency+Manage ment
> For example, you can enable that in your pom.xml using something like
> this:
>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>xslt-maven-plugin</artifactId>
> <version>1.0</version>
> <executions>
> <execution>
> <phase>process-resources</phase>
> <goals>
> <goal>transform</goal>
> </goals>
> </execution>
> </executions>
>
> Then your plugin will be executed in-process on resource change or on
> project clean and if there is any errors during execution those errors
> will be shown in the Problems view.
>
> I've verified that plugin is executed properly, however there are
> couple things that are getting into the way.
>
> First of all, m2eclipse is currently not monitoring resources and
> rely on other plugins, such as JDT. So, you will need to use Project /
> Clean... to force build manually.
>
> For some reason, xslt plugin errors are being ignored and does not
> appear in the Problems view. This look like a bug and it need to be
> investigated. If you are interested in this feature, please open a
> JIRA issue in the project tracker at
> http://jira.codehaus.org/browse/MNGECLIPSE and link to this thread or
> attach your test project up there.
>
> Thanks
>
> Eugene
>
|
|
|
Re: How to add Eclipse marker on file when Maven build failed ? [message #13627 is a reply to message #13605] |
Wed, 30 July 2008 12:20  |
Eclipse User |
|
|
|
JY wrote:
> Have you got a Eclipse sample project correctly configured where this
> feature is working properly?
>
> Because even with your explanations, I can not make it work! :(
Sorry, which part does not work for you?
As I mentioned in my email, the errors are being ignored, but xslt
builder been called when I added additional goals in Maven properties
for that test project. If you are interested to see issue with ignored
errors fixed, please open a jira issue, so we can properly track it.
Thanks
Eugene
> Eugene Kuleshov wrote:
>> JY wrote:
>>> Here an Eclipse 3.4 (with m2Eclipse 0.9.5.20080717-1819) project
>>> which uses the regular XSLT MOJO from :
>>> http://mojo.codehaus.org/xslt-maven-plugin/
>> I needed some time to investigate this. Sorry about delay.
>>
>>> In this Eclipse project, XSLT Mojo is bound to process-resources
>>> phase in pom.xml
>>>
>>> I have inserted an XPath error in the XSL file
>>> (src/main/teplate/xsl/main.xsl line 7)
>>>
>>> No marker in "Problems" view, while an exception is thrown in the
>>> Eclipse "Console" view :
>> If you do it like this, more specifically, using Maven launch
>> configuration, we can't add error markers for the failed builds
>> because that build is running in a separate JVM. We may consider to
>> have an option to run those in-process, but it is not available right
>> now (also note that in-process Maven runtime will have to be Maven
>> 2.1 level, same as Embedded, and it have some incompatibilities with
>> Maven 2.0).
>>
>> However, what I was referring in my previous message is that you can
>> specify additional goals to execute or bind your plugin to
>> process-resources build phase which is executed by default. See
>> http://docs.codehaus.org/display/M2ECLIPSE/Dependency+Manage ment
>> For example, you can enable that in your pom.xml using something
>> like this:
>>
>> <plugin>
>> <groupId>org.codehaus.mojo</groupId>
>> <artifactId>xslt-maven-plugin</artifactId>
>> <version>1.0</version>
>> <executions>
>> <execution>
>> <phase>process-resources</phase>
>> <goals>
>> <goal>transform</goal>
>> </goals>
>> </execution>
>> </executions>
>>
>> Then your plugin will be executed in-process on resource change or
>> on project clean and if there is any errors during execution those
>> errors will be shown in the Problems view.
>>
>> I've verified that plugin is executed properly, however there are
>> couple things that are getting into the way.
>>
>> First of all, m2eclipse is currently not monitoring resources and
>> rely on other plugins, such as JDT. So, you will need to use Project
>> / Clean... to force build manually.
>>
>> For some reason, xslt plugin errors are being ignored and does not
>> appear in the Problems view. This look like a bug and it need to be
>> investigated. If you are interested in this feature, please open a
>> JIRA issue in the project tracker at
>> http://jira.codehaus.org/browse/MNGECLIPSE and link to this thread or
>> attach your test project up there.
>>
>> Thanks
>>
>> Eugene
>>
>
|
|
|
Goto Forum:
Current Time: Sat May 10 00:26:27 EDT 2025
Powered by FUDForum. Page generated in 0.03951 seconds
|