What would have to be enhanced or created so that dirs specified by maven-jaxb2-plugin are updated in Build Path sources? #894
Replies: 2 comments
-
I think it's the right connector to enhance; and I guess enhancing it is the best way to improve the jaxb2 integration in m2e.
Another altenative is to make the jaxb2 Maven plugin aware of m2e (using https://www.eclipse.org/m2e/documentation/m2e-making-maven-plugins-compat.html ) and configuring the .project and .classpath according to its execution; but I fear it's equally not updated in a long time. |
Beta Was this translation helpful? Give feedback.
-
There is a general problem in m2e that it does not discovers (dynamically) added source folders, so there would be some chance to fix this in m2e directly, creating an issue with a minimal example would help here. |
Beta Was this translation helpful? Give feedback.
-
I'm currently on the latest version of Eclipse, 2022-06.
We use the "maven-jaxb2-plugin" to generate classes from wsdl and schemas. It appears that something automatically edits the Build Path so that the source directories includes "target/generated-sources/xjc". I'm not certain what controls that.
If a service has more than one execution block for this plugin, because it's generating source from more than one input, it's not really valid to have both blocks generate code into the same root directory. Therefore, we have to edit the "generateDirectory" property to add a suffix directory.
This change by itself does everything that is needed from a command-line build point of view. In Eclipse, there's an additional manual change that is required, which is editing the Build Path in project properties, removing "target/generated-sources/xjc" and replacing it with two or more entries corresponding to the two or more directories being written to now.
It would be nice if that alteration could be done automatically.
Looking in Eclipse, I see that I have the "m2e connector for jaxb2". This may be the connector applicable for this, but I'm not sure. I also have a feeling it hasn't been updated in a long time. Is this what would have to be enhanced, or is there something else in place that might do this, or would some new connector have to be written for this?
Beta Was this translation helpful? Give feedback.
All reactions