Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Dubious org.eclipse.jdt.core.compiler.problem.forbiddenReference setting in AbstractJavaProjectConfigurator

-1. this will break existing projects. m2e should maintain parity with
command line build to the extend possible. I am +0 making it possible to
configure this in pom.xml, ideally both for command line and m2e.

Also, lets use m2e-dev for this kind of discussions.

--
Regards,
Igor

On 2013-01-31 11:52 AM, Fred Bricon wrote:
Hi,

by default (i.e. with stock workspace settings), forbidden references
raise errors. But in AbstractJavaProjectConfigurator[1], the default
forbiddenReference value is always set to "warning", unless user
preferences have already been set[2]) Any idea why?

Only reason I see would be to make eclipse as lenient as maven, but I
believe this is precisely a situation where we want the IDE to be stricter.
Ex: would better detect the use of JVM specific classes and force users
to conscientiously change the forbidden references settings in Project
Properties > Java > Compiler > Error/Warnings > Deprecated and
Restricted API. These custom settings being preserved on Maven Project
Update.

Another reason to keep the default workspace value is I want to be able
to add custom access rules on EJB projects dependencies, in order to
simulate "ejb-client" type dependencies in m2e-wtp. In that use case, I
expect any project depending on non-ejbclient vetted class would see an
error (red marker).

Soooo, I propose we remove that piece of code in
AbstractJavaProjectConfigurator :

     // 360962 keep forbidden_reference severity set by the user
     IJavaProject jp = JavaCore.create(request.getProject());
     if(jp != null &&
jp.getOption(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, true) == null) {
      options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, "warning");
//$NON-NLS-1$
     }

Any objections?

Fred Bricon

[1]
http://git.eclipse.org/c/m2e/m2e-core.git/diff/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java?id=3d354e58f72f7385ed8a3f817cedec61106d32c1
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=360962
--
"Have you tried turning it off and on again" - The IT Crowd


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users



Back to the top