Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Control adding plugin processors to factorypath #65

Closed
VsevolodGolovanov opened this issue Aug 7, 2018 · 6 comments
Closed

Control adding plugin processors to factorypath #65

VsevolodGolovanov opened this issue Aug 7, 2018 · 6 comments
Milestone

Comments

@VsevolodGolovanov
Copy link

VsevolodGolovanov commented Aug 7, 2018

We have a bunch of projects. We used to get all sorts of unwanted stuff in factory paths, so for a long time we kept m2e-apt completely disabled and just kept relevant Eclipse project APT configs. But keeping duplicate configs is not very good, and it results in problems when trying out the Developer Studio 12.

So now I saw issue #13 and tried configuring processing like this:

<plugin>
	<artifactId>maven-compiler-plugin</artifactId>
	<configuration>
		<annotationProcessorPaths>
			<annotationProcessorPath>
				<groupId>org.hibernate</groupId>
				<artifactId>hibernate-jpamodelgen</artifactId>
				<version>5.0.10.Final</version>
			</annotationProcessorPath>
		</annotationProcessorPaths>
	</configuration>
</plugin>

With the Developer Studio 11.1.0.GA this resulted in a much cleaner factorypath than what we used to get:

<factorypath>
    <factorypathentry kind="VARJAR" id="M2_REPO/org/hibernate/hibernate-jpamodelgen/5.0.10.Final/hibernate-jpamodelgen-5.0.10.Final.jar" enabled="true" runInBatchMode="false"/>
    <factorypathentry kind="VARJAR" id="M2_REPO/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar" enabled="true" runInBatchMode="false"/>
    <factorypathentry kind="PLUGIN" id="org.eclipse.jst.ws.annotations.core" enabled="true" runInBatchMode="false"/>
</factorypath>

But this org.eclipse.jst.ws.annotations.core is still there. It generates a lot of error markers (hundreds) that aren't very useful. So we don't want it enabled. Could m2e-apt allow not adding or disabling it somehow?

@VsevolodGolovanov
Copy link
Author

There must be some criteria (non m2e-apt) that decides if this gets added to factory path, but I'm not sure what it is. The projects don't have any explicit "Web Services" facets enabled...

@fbricon
Copy link
Member

fbricon commented Aug 8, 2018

org.eclipse.jst.ws.annotations.core is added automatically by JDT APT. I believe this is used to contribute annotation processors from Eclipse plugins, but I'm not 100% certain. I never found how to disable it (but I haven't searched extensively either).

What kind of error markers does it generate?

@VsevolodGolovanov
Copy link
Author

@WebService annotation contains an endpointInterface attribute. No methods annotated with @WebMethod allowed in implementation class	

@WebService annotation contains an endpointInterface attribute. No name attribute allowed

Probably valid, but should be a warning.

Abstract class javax.xml.datatype.XMLGregorianCalendar cannot be used as a runtime class because it is not extended by a non abstract class which is suitable as a runtime class

Invalid, runtime will be different.

Generated Request/Response and Fault bean classes must have unique names within a package and must not clash with other classes in that package

Not sure.

java.util.Set is an interface and may not be used as a return type or method parameter as JAXB cannot handle interfaces

Seems valid, but it works somehow. Maybe there is more type information hidden in related files.

Operation names must be unique

Invalid: it complains about overloaded class method names, because it doesn't see the corresponsing unique operation names in the interface.

The wrapper bean localName attributes must be unique

No idea. The only google result for this is http://git.eclipse.org/c/webtools/org.eclipse.webtools.incubator.git/tree/webservices/plugins/org.eclipse.jst.ws.jaxws.core/src/org/eclipse/jst/ws/internal/jaxws/core/JAXWSCoreMessages.properties?h=origin&id=a449d9c75b961ae77e4b0f7f9eef725d115999e8

@VsevolodGolovanov
Copy link
Author

VsevolodGolovanov commented Sep 3, 2018

For now we have to keep the separate Eclipse configs (org.eclipse.jdt.apt.core.prefs, org.eclipse.jdt.core.prefs, .factorypath).
But if I import such projects (as Existing Maven Projects) in DevStudio 12, then the test generated source directory gets added to the Deployment Assembly (Problem 1)!

<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="rms">
        <wb-resource deploy-path="/" source-path="/src/main/resources" tag="defaultRootSource"/>
        <wb-resource deploy-path="/" source-path="/src/main/java"/>
        <wb-resource deploy-path="/" source-path="/target/generated-sources/apt"/>
        <wb-resource deploy-path="/" source-path="/target/generated-test-sources/test-annotations"/>
        <property name="java-output-path" value="/rms/target/classes"/>
    </wb-module>
</project-modules>

Which for some reason leads to all test classes and resources being deployed, not just the generated ones (Problem 2)! Removing the test source directory from the Deployment Assembly does fix it, but I don't want to manually manage org.eclipse.wst.common.component (Deployment Assembly) files too.

Ugh. I don't know if there is even a point of reporting these subsequent problems... I guess if I create isolated reproducers then maybe...

And there is apparently no way to disable test source processing with DS12. I asked for this in https://bugs.eclipse.org/bugs/show_bug.cgi?id=533480 ...

@fbricon fbricon added this to the 1.5.2 milestone Nov 21, 2018
@famod
Copy link

famod commented Dec 20, 2018

@fbricon Thanks for the fix/workaround - works as expected for me!
Are you going to release 1.5.2 anytime soon?

@fbricon
Copy link
Member

fbricon commented Dec 24, 2018

@famod the update site has been updated as well as the Eclipse marketplace

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

No branches or pull requests

3 participants