[jbosstools-dev] new build-time enforcement in parent pom

Nick Boldt nboldt at redhat.com
Thu Oct 20 11:36:26 EDT 2016


Last night I pushed a new maven enforcer custom rule that Rob created
[0] into the jbosstools-maven-plugins repo, and wired it up in our
parent pom.

[0] https://issues.jboss.org/browse/JBIDE-23380

This rule simply checks your plugins to ensure that your .core-named
plugins don't directly or transitively depend on a .ui plugin, which
is of course something we want to avoid.

If you see a message like the one below when building, you can at some
point decide you want to open a JIRA and begin refactoring your code
so that you don't have UI dependencies from a Core plugin.

[INFO] --- maven-enforcer-plugin:1.4.1:enforce (core-has-ui-deps) @
org.jboss.tools.common.resref.core ---
[WARNING] Rule 0: org.jboss.tools.releng.CoreUIDependency failed with message:
[CoreUIDependency] org.jboss.tools.common.resref.core is a Core
plugin, but depends on these UI plugins directly or transitively:
     > org.eclipse.ui
     > org.eclipse.jdt.ui
     > org.eclipse.wst.sse.ui
     > org.eclipse.ui.workbench
     > org.eclipse.ui.ide
     > org.eclipse.ui.views.log
     > org.eclipse.ui.workbench.texteditor
     > org.eclipse.wst.xml.ui

If your local build fails to resolve the new rule, simply rebuild with
`mvn -U` to fetch the latest snapshot from Nexus.

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce
(core-has-ui-deps) on project org.jboss.tools.openshift.client:
Execution core-has-ui-deps of goal
org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce failed.
NullPointerException -> [Help 1]

Note that Mickael reverted the commit [1] in parent pom as a quick fix
to the above NPE (because no one thought to just use -U), but unless
there's a reason NOT to include it, I'll be re-adding it soon so you
can all know where you have UI deps in you core code.

[1] https://github.com/jbosstools/jbosstools-build/commit/4000a34faf594e35d1897e7b66c9832dca7ff5be

And knowing is half the battle! [2]

-- 
Nick Boldt :: JBoss by Red Hat
Productization Lead :: JBoss Tools & Dev Studio
http://nick.divbyzero.com

[2] https://www.google.ca/search?q=and+knowing+is+half+the+battle+meme&tbm=isch&tbo=u&source=univ&sa=X&ved=0ahUKEwijsczO2unPAhUGTCYKHV4CAS8QsAQIHQ&biw=1920&bih=935


More information about the jbosstools-dev mailing list