Gradle build and Maven Repositories

75 views
Skip to first unread message

David Leangen

unread,
May 31, 2017, 1:37:30 AM5/31/17
to bndtool...@googlegroups.com

Hi!

I am using this tutorial:



From within Eclipse, all is fine. I can read from Central and Local, and I am able to deploy to Nexus. Very cool!

When I try to build from gradle, however, I am having problems. Please see error stack below.

:osgi.enroute.examples.eval.api:compileJava
Error  : Failed to load plugin aQute.bnd.repository.maven.provider.MavenBndRepository;releaseUrl="https://repo.maven.apache.org/maven2/";name=Central, error: aQute.bnd.repository.maven.provider.MavenBndRepository not found, parent:  org.gradle.internal.classloader.MutableURLClassLoader@489634c7 urls:[] exception:java.lang.ClassNotFoundException: aQute.bnd.repository.maven.provider.MavenBndRepository 
Error  : Cannot load the plugin aQute.bnd.repository.maven.provider.MavenBndRepository
Error  : Failed to load plugin aQute.bnd.repository.maven.provider.MavenBndRepository;name=Local, error: aQute.bnd.repository.maven.provider.MavenBndRepository not found, parent:  org.gradle.internal.classloader.MutableURLClassLoader@489634c7 urls:[] exception:java.lang.ClassNotFoundException: aQute.bnd.repository.maven.provider.MavenBndRepository 
Error  : Failed to load plugin aQute.bnd.repository.maven.provider.MavenBndRepository;releaseUrl="http://repo.example.com/repository/maven-snapshots/";snapshotUrl="http://repo.example.com/repository/maven-snapshots/";name=Release, error: aQute.bnd.repository.maven.provider.MavenBndRepository not found, parent:  org.gradle.internal.classloader.MutableURLClassLoader@489634c7 urls:[] exception:java.lang.ClassNotFoundException: aQute.bnd.repository.maven.provider.MavenBndRepository 
Error  : osgi.enroute.examples.maven :Failed to load plugin aQute.bnd.repository.maven.provider.MavenBndRepository;releaseUrl="https://repo.maven.apache.org/maven2/";name=Central, error: aQute.bnd.repository.maven.provider.MavenBndRepository not found, parent:  org.gradle.internal.classloader.MutableURLClassLoader@489634c7 urls:[] exception:java.lang.ClassNotFoundException: aQute.bnd.repository.maven.provider.MavenBndRepository 
Error  : osgi.enroute.examples.maven :Cannot load the plugin aQute.bnd.repository.maven.provider.MavenBndRepository
Error  : osgi.enroute.examples.maven :Failed to load plugin aQute.bnd.repository.maven.provider.MavenBndRepository;name=Local, error: aQute.bnd.repository.maven.provider.MavenBndRepository not found, parent:  org.gradle.internal.classloader.MutableURLClassLoader@489634c7 urls:[] exception:java.lang.ClassNotFoundException: aQute.bnd.repository.maven.provider.MavenBndRepository 
Error  : osgi.enroute.examples.maven :Failed to load plugin aQute.bnd.repository.maven.provider.MavenBndRepository;releaseUrl="http://repo.example.com/repository/maven-snapshots/";snapshotUrl="http://repo.example.com/repository/maven-snapshots/";name=Release, error: aQute.bnd.repository.maven.provider.MavenBndRepository not found, parent:  org.gradle.internal.classloader.MutableURLClassLoader@489634c7 urls:[] exception:java.lang.ClassNotFoundException: aQute.bnd.repository.maven.provider.MavenBndRepository 
:osgi.enroute.examples.eval.api:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':osgi.enroute.examples.eval.api:compileJava'.
> Project osgi.enroute.examples.eval.api has errors, 8 errors were reported

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.729 secs


Any ideas?
Thanks!

David Leangen

unread,
May 31, 2017, 1:39:54 AM5/31/17
to bndtools-users

Sorry, I just noticed this recent post:



I'll go through that first.

Cheers,
=David

David Leangen

unread,
May 31, 2017, 1:53:24 AM5/31/17
to bndtools-users
Updating to 3.3.0 gets me past that error, but now I see this:

:osgi.enroute.examples.eval.provider:compileJava

/Users/dleangen/git/osgi.enroute.examples.maven/osgi.enroute.examples.eval.provider/src/main/java/osgi/enroute/examples/eval/provider/EvalImpl.java:7: error: package org.osgi.service.component.annotations does not exist

import org.osgi.service.component.annotations.Activate;

                                             ^

/Users/dleangen/git/osgi.enroute.examples.maven/osgi.enroute.examples.eval.provider/src/main/java/osgi/enroute/examples/eval/provider/EvalImpl.java:8: error: package org.osgi.service.component.annotations does not exist

import org.osgi.service.component.annotations.Component;

                                             ^

/Users/dleangen/git/osgi.enroute.examples.maven/osgi.enroute.examples.eval.provider/src/main/java/osgi/enroute/examples/eval/provider/EvalImpl.java:10: error: package com.google.common.math does not exist

import com.google.common.math.DoubleMath;

                             ^

/Users/dleangen/git/osgi.enroute.examples.maven/osgi.enroute.examples.eval.provider/src/main/java/osgi/enroute/examples/eval/provider/EvalImpl.java:14: error: package osgi.enroute.examples.eval.api does not exist

import osgi.enroute.examples.eval.api.Eval;

                                     ^

/Users/dleangen/git/osgi.enroute.examples.maven/osgi.enroute.examples.eval.provider/src/main/java/osgi/enroute/examples/eval/provider/EvalImpl.java:15: error: package parsii.eval does not exist

import parsii.eval.Expression;

                  ^

/Users/dleangen/git/osgi.enroute.examples.maven/osgi.enroute.examples.eval.provider/src/main/java/osgi/enroute/examples/eval/provider/EvalImpl.java:16: error: package parsii.eval does not exist

import parsii.eval.Function;

                  ^


And numerous other errors that follow.

There is something wrong with the classpath and resolution.

The only thing I did to the project (which fixed my workspace in Eclipse) was this:

-               locations       =       https://raw.githubusercontent.com/osgi/osgi.enroute/master/cnf/distro/index.xml

+               locations       =       https://raw.githubusercontent.com/osgi/osgi.enroute/v1.7.0/cnf/distro/index.xml


Any ideas?


Thanks!
=David


Peter Kriens

unread,
May 31, 2017, 3:22:40 AM5/31/17
to bndtool...@googlegroups.com
Eh, this project is setup to be run maven, not Gradle?

Kind regards,

Peter Kriens

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Leangen

unread,
May 31, 2017, 3:26:24 AM5/31/17
to bndtool...@googlegroups.com

Hi Peter,

Thanks for your reply.


Ok, so I’m a bit confused. Are you saying that the MavenBndRepository cannot be used with Gradle?

It was my understanding that the IndexedRepositories were being phased out and replaced by the Maven Repositories. Are you implying that Gradle is also going away in favour of Maven?


If that is not the case, and it is compatible with Gradle, then where can I learn how to use the Maven Repositories with Gradle? Specifically, I was thinking about integrating it into my release process, using Nexus.


Sorry, a lot seems to be changing and I have not been very good at keeping up with the times… Thanks for pointing me in the right direction. :-)


Cheers,
=David

Peter Kriens

unread,
May 31, 2017, 4:09:39 AM5/31/17
to bndtool...@googlegroups.com
Yes, you can use any repository with type of build. However, the example you picked was setup for maven.


Kind regards,

Peter Kriens

David Leangen

unread,
May 31, 2017, 4:42:31 AM5/31/17
to bndtool...@googlegroups.com

Brilliant, thanks Peter!

=David

David Leangen

unread,
Jun 1, 2017, 6:01:57 PM6/1/17
to bndtool...@googlegroups.com

The AppNote is very helpful, thanks! It is very easy to release to Nexus as shown in the AppNote.

The AppNote describes using the staging feature on Nexus. Apparently, this feature is only available with Nexus Pro.

The price for Nexus Pro is $10 / user, which is a nice price, and I would be happy to pay. However, they ask for 10 users minimum. Currently, I am a single user investing in a project which is not yet brining in any revenue, so it is out of my budget. :-(


Does anybody know of something with similar functionality? Or am I completely on my own?

Not intending to start a philosophical debate about capitalism. I only ask here because the AppNote is (intentionally or not) endorsing this solution.


Cheers,
=David

Peter Kriens

unread,
Jun 8, 2017, 4:40:00 AM6/8/17
to bndtool...@googlegroups.com
I actually wasn’t aware it was a PRO option, guess that should be added to the app note.

However, I think you can release to an open source Nexus as well? The only difference with a staging repo and a normal repo is the URL.

Can you update the PR with this info?

Kind regards,

Peter Kriens

David Leangen

unread,
Jun 8, 2017, 4:41:53 AM6/8/17
to bndtool...@googlegroups.com

Hi Peter,

Sure, I can do that. I am also looking around for other types of options. If I find anything worth sharing, I’ll include it in the AppNote.


Cheers,
=David
Reply all
Reply to author
Forward
0 new messages