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 Andreas,

Thanks for the explanation.

I figured out that it had to do with the java version of org.eclipse.jdt.annotation pulg-in.

The problem is that I cannot track it down.

From what I see in the IDE, XText brings in this dependency ( at least for the o.e.r.templates project) . But the version is 1.1.0 and not 2.0+. This is the only version of o.e.jdt.annotation that appears in the dependency tree-hierarchy.

I’ve also noticed that Xtext no longer re-exports the o.e.jdt.annotation plug-in. [1]
Maybe it has something to do with this?

What seemed to do the trick was to change the repositor in the luna.target file to from <http://download.eclipse.org/releases/luna> to  <http://download.eclipse.org/releases/kepler>, but this is not a solution, and I don’t think we want to do this.

Also, maven pulls both the 1.1.0 and the 2.0.0 versions of o.e.jdt.annotation into the local repository. 

From: Andreas Sewe
Sent: ‎Monday‎, ‎May‎ ‎12‎, ‎2014 ‎7‎:‎49‎ ‎PM
To: recommenders-dev@xxxxxxxxxxx

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
_______________________________________________
recommenders-dev mailing list
recommenders-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/recommenders-dev

Back to the top