Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metadata necessary to be recognized by m2e out of the box #820

Closed
odrotbohm opened this issue Mar 10, 2020 · 6 comments
Closed

Add metadata necessary to be recognized by m2e out of the box #820

odrotbohm opened this issue Mar 10, 2020 · 6 comments
Assignees
Milestone

Comments

@odrotbohm
Copy link
Contributor

@odrotbohm odrotbohm commented Mar 10, 2020

It would be cool if the ByteBuddy Maven plugin would automatically be detected and properly executed within m2e (Eclipse Maven integration). Ideally that would also cause execution errors to properly reported in Eclipse's problems view etc.

Currently m2e is not able to detect proper lifecycle mappings (see the docs)but you can Eclipse to invoke the plugin by editing the lifecycle metadata configuration (Settings > Maven > Lifecycle Mappings > Open workspace lifecycle mappings metadata) and adding the following snippet of XML.

<pluginExecution>
  <pluginExecutionFilter>
    <groupId>net.bytebuddy</groupId>
    <artifactId>byte-buddy-maven-plugin</artifactId>
    <versionRange>[0.0.1,)</versionRange>
    <goals>
      <goal>transform</goal>
    </goals>
  </pluginExecutionFilter>
  <action>
    <execute>
      <runOnIncremental>true</runOnIncremental>
    </execute>
  </action>
</pluginExecution>

The m2e developer documentation contains useful hints on what it takes to make this work.

@raphw
Copy link
Owner

@raphw raphw commented Jul 9, 2020

Fixed bt #897.

@odrotbohm
Copy link
Contributor Author

@odrotbohm odrotbohm commented Jul 30, 2020

Looks like this has been resolved and published already? According to Maven Central 1.10.13 is already out. I can definitely see the plugin work OOTB in Eclipse with that version.

@odrotbohm
Copy link
Contributor Author

@odrotbohm odrotbohm commented Jul 30, 2020

I have to take that back. After a M2E configuration cleanups and a restart I am back to where I started. A bit of investigation revealed that the current version of the metadata file simply contains:

<action>
  <execute />
</action>

whereas the developer documentation states that <runOnIncremental>true</runOnIncremental> would be needed to execute the plugin during Eclipse builds.

I am a bit puzzled not to even find that file (META-INF/m2e/lifecycle-mapping-metadata.xml) at all in the JARs obtained from Maven Central. I just built the plugin locally and that seems to package it at least up appropriately. Does that somehow not get package when releasing? Using the locally built 1.10.14-SNAPSHOT with the config file included as is makes the IDE error go away. So it looks like it boils down to the file missing in the JAR, not the content.

@odrotbohm
Copy link
Contributor Author

@odrotbohm odrotbohm commented Jul 30, 2020

A final one hopefully. What I observed is essentially caused by #896 fixed by #897, just as linked to above. I guess what added to my confusion is that the ticket is still assigned to 1.10.8, a still open but already released milestone. Does it make sense to flip the fix version for this one here to 1.10.14, too as it effectively needs #897 to be fully resolved and that one will be in 1.10.14 the earliest.

@raphw
Copy link
Owner

@raphw raphw commented Jul 14, 2021

I am closing this as I understand that this issue is resolved? Please let me know if something is missing here.

@raphw raphw closed this as completed Jul 14, 2021
@odrotbohm
Copy link
Contributor Author

@odrotbohm odrotbohm commented Jul 14, 2021

It is indeed. Thanks, Raphael!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants