Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [recommenders-dev] Snipmatch Build problem

Hi Stefan,

> I’m getting the following error when building Snipmatch from the
> incubator repository [1] using the /mvn clean verify/ command(full error
> at [2]):
> 
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce
> (enforce-bytecode-version) on project
> org.eclipse.recommenders.templates: Some Enforcer rules have failed.
> Look above for specific messages explaining why the rule failed.
> 
> With the above warning:
> 
> [WARNING] Rule 0:
> org.apache.maven.plugins.enforcer.EnforceBytecodeVersion failed with
> message:
> Found Banned Dependency:
> p2.eclipse-plugin:org.eclipse.jdt.annotation:jar:2.0.0.v20140415-1436

first a brief explanation of what this is trying to do. We at Code
Recommenders want (for now; this may change in the future) be Java 1.6
compatible. In other words, all our bundles should have a

  Bundle-RequiredExecutionEnvironment: JavaSE-1.6

header in their MANIFEST.MF. But such a header alone doesn't make us
compatible; we also need to make sure that we use only Java 6 APIs
(that's what the animalsniffer-maven-plugin is configured to do [1]) and
that the bytecode the compiler produces is compatible with Java 6
(that's what the maven-enforcer-plugin is configured to do).

Now, it is not sufficient if you yourself are Java 6 compatible if one
of your dependencies requires Java 7 or 8; then obviously Java-6 users
cannot use your code anymore. Hence, the check extends to dependencies.

The dependency in question requires Java 8
(Bundle-RequiredExecutionEnvironment: JavaSE-1.8) and uses the Java 8
bytecode version. That's a problem.

Now, what you should do is figure out why you have this dependency.
Using the maven-dependency-plugin for this is not the best option,
though, at least not in a Tycho build. Just use your IDE instead. On the
Dependencies tab of your plugin you'll find an item "Dependency
Analysis". There, you can browse a dependency tree and should be easily
able to identify the cause of the problem.

Once you know the dependency chain that pulls in
org.eclipse.jdt.annotation (in version 2.0+), we can figure out how to
avoid this.

Hope this helps.

Andreas

[1]
<https://git.eclipse.org/c/recommenders/org.eclipse.recommenders.git/tree/pom.xml?id=v2.0.7#n373>

-- 
Codetrails UG (haftungsbeschränkt)
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940


Back to the top