bndtools 2.4.0 M1 Too many Eclipse source sets defined, bnd project can have at most 2

193 views
Skip to first unread message

Adam Purkiss

unread,
Sep 16, 2014, 3:33:22 PM9/16/14
to bndtool...@googlegroups.com
I am trying to understand why bnd has this odd error. I have a couple of source folders and a test folder and thus I get the following error and linked to that I get an error that my test folder is not named test.

Description Resource Path Location Type
Too many Eclipse source sets defined, bnd project can have at most 2 bnd.bnd /DwsLibs Unknown Bndtools Problem Marker


Does anyone know why this is in place and how I can remove the error without removing the imported source folders I need for the project?

Failing that can I change this error to a warning so I don't have red everywhere? The red makes me think that I need to worry about projects that in fact are perfectly ok.


thanks

Adam

BJ Hargrave

unread,
Sep 16, 2014, 3:36:06 PM9/16/14
to bndtool...@googlegroups.com
bnd only supports a single src folder and a single test folder for test case code. You cannot use multiple source folders with bnd/bndtools.

This is an error since bndtools wants fidelity between the IDE and command line builds for bnd nature projects.
--
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.
-- 
BJ

open fokus

unread,
Sep 16, 2014, 4:15:02 PM9/16/14
to bndtool...@googlegroups.com
Hi Adam
I got the same error after upgrading to the latest version, if, like me, you need a source folder to get resources copied automatically to bin or bin_test you can create a folder under src or test and then right-click on that folder and say: "Build Path -> Include"

@BJ: although I do like very much some of the enhancements of the new version , in particular the resolve dialogue in case of unfulfilled requirements, I believe the decision to restrict users to only two source sets is, in my view , debatable: you are limiting useful features of an existing tool to make it conform to missing features of a more recent tool. Why put fetters on a powerful tool like eclipse to make it fit to a command line tool ? This is like if you were saying "lower your screen resolution because my terminal window only supports 256 colors."

Perhaps some other solution will come up .. or perhaps I am missing something ?

Best regards
Peter

BJ Hargrave

unread,
Sep 16, 2014, 4:19:38 PM9/16/14
to bndtool...@googlegroups.com
This is not a new limitation. bnd has only ever supported a single source folder and thus so has bndtools. What may be new is how this condition is reported in bndtools.

open fokus

unread,
Sep 16, 2014, 4:40:16 PM9/16/14
to bndtool...@googlegroups.com
But before the upgrade, this limitation has not stopped me to use bnd with more than two sets, now I get a red cross which signals an error. So its a bit confusing , at least for me. What exactly does "support" mean in this case ? I don't mean to sound picky, I just try to understand what exactly is the reason for this restriction.
Best regards
Peter

BJ Hargrave

unread,
Sep 16, 2014, 4:49:40 PM9/16/14
to bndtool...@googlegroups.com
In Eclipse, the eclipse java compiler understands multiple source folders. But bnd does not. In the bnd file, the src property must point to a single folder. You probably have eclipse set to put all the output in a single folder which allows bnd to see all the output to package the bundle jar. But for a command line build (ant, gradle), the source path for the compiler is configured from the bnd src property which is a single folder.

I suspect the bndtools has recently been changed to point out this error condition which was not noticed in earlier releases. (I mostly work on bnd so I am less familiar with recent bndtools changes. bnd is the main engine while bndtools is the eclipse IDE integration for bnd.)

So this is not a new “restriction” since bnd has only ever supported a single source folder.

open fokus

unread,
Sep 16, 2014, 5:54:21 PM9/16/14
to bndtool...@googlegroups.com
Thanks, BJ for the explanation, that makes it clearer for me and it helps me to understand better what is the realm of bnd and what is controled by bndtools.
Peter

Peter Kriens

unread,
Sep 17, 2014, 3:17:17 AM9/17/14
to bndtool...@googlegroups.com
BJ is right, it is not a limitation in bnd (bnd hardly uses the source folders and it also has -sourcepath for finding sources) but some of the target environments for bnd would have a hard time understanding multiple source folders, I think maven also only has one Java source folder. So therefore bnd is restricted. If you ever only work in Eclipse this may be painful because you loose some of the goodies but the advantage is that your continuous integration will be up and running quickly.

The primary goal, actually its raison d'etre, of bnd is to make sure that what happens in Eclipse (and hopefully soon Intellij) is actually identical to what happens in Gradle, ant, etc. We are striving for bit-wise identical artifacts.

Sometimes these restrictions hurt, I know.

Kind regards,

Peter Kriens

open fokus

unread,
Sep 17, 2014, 4:15:19 AM9/17/14
to bndtool...@googlegroups.com
Thanks Peter, this will encourge me to spend some time with the gradle build, to better appreciate what is eclipse-specific and what is "headless", indeed if you only work with eclipse, some of the under-the-cover behavior is confusing, but this is of course a general problem with IDEs.

As a minor improvement, I would suggest, that the error message should perhaps be:

Too many *Eclipse source folders on build path* , .... at most 2.  

instead of:
Too many *Eclipse source sets defined*, ....

to match the exact terms in the project properties widget.

Best regards
Peter

Adam Purkiss

unread,
Sep 17, 2014, 6:33:16 AM9/17/14
to bndtool...@googlegroups.com

Thanks for the info. I would add a small request if possible and that would be to allow the error to be downgraded to a warning like eclipse can else where. Not a major item but for users like me where we have eclipse setup like we have and have bnd working fine as well it allows us to be reminded we have done something we really should not without the big red x :)

You received this message because you are subscribed to a topic in the Google Groups "bndtools-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bndtools-users/UNL5Pr5SElE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bndtools-user...@googlegroups.com.
Message has been deleted

Matt Butler

unread,
Dec 1, 2014, 1:12:42 PM12/1/14
to bndtool...@googlegroups.com
I just ran into this. The use case is that I am using ANTLR and it does code-generation and as such should put the generated code into generated/...  I was able to create a build.gradle file for the subproject that uses ANTLR, have it generate the code into generated, have Gradle compile the genrerated code AND the hand written code, and it all works. Both on my machine and in our CI environment. So there is no Gradle limitation to work around here, and bnd seems to work fine with this configuration. 

It seems to simply be a bndtools limitation. 

matt

Dan Gravell

unread,
May 18, 2015, 9:17:39 AM5/18/15
to bndtool...@googlegroups.com
Hmmm, I'm still on 2.3.0 and this morning I've started getting this. I have tried upgrading to 2.4.1 then downgrading back to 2.3.0 but still get the same thing.

I'm assuming bndtools has updated when I updated the Google Eclipse plugin... although I was careful to uncheck the bndtools update option.

Anyway, the fact that 2.3.0 doesn't solve this makes me think something has happened on the update servers.

Currently I have an unusable workspace... anybody have any ideas?

Dan

BJ Hargrave

unread,
May 18, 2015, 9:29:41 AM5/18/15
to bndtool...@googlegroups.com
On May 18, 2015, at 09:17 , Dan Gravell <d...@elstensoftware.com> wrote:

Hmmm, I'm still on 2.3.0 and this morning I've started getting this. I have tried upgrading to 2.4.1 then downgrading back to 2.3.0 but still get the same thing.

I'm assuming bndtools has updated when I updated the Google Eclipse plugin... although I was careful to uncheck the bndtools update option.

Yes, thats what it sounds like. If you look at your plugins you may see versions of the bnd/bndtools plugins later then 2.3.


Anyway, the fact that 2.3.0 doesn't solve this makes me think something has happened on the update servers.

Currently I have an unusable workspace... anybody have any ideas?

Try a fresh eclipse install and then install bndtools 2.3 into it. You can install 2.3 from the update site at https://dl.bintray.com/bndtools/bndtools/2.3.0/.


Dan

--
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.

-- 

BJ



Dan Gravell

unread,
May 18, 2015, 9:57:07 AM5/18/15
to bndtool...@googlegroups.com
Crikey, I really don't have the time to be starting over like that.

I tried installing from the bintray repository after clearing out all bndtools and aQute plugins/features, this doesn't even complete:

An error occurred during the org.eclipse.equinox.internal.p2.engine.phases.CheckTrust phase.
session context was:(profile=SDKProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.CheckTrust, operand=, action=).
Error reading signed content.
The file "/opt/eclipse-juno/plugins/biz.aQute.bndlib_2.3.0.201405100607.jar" does not exist

Installing from s3 as per the bndtools website does complete but gives me the "Too many Eclipse source sets defined" error message.

Dan

Dan Gravell

unread,
May 18, 2015, 10:16:03 AM5/18/15
to bndtool...@googlegroups.com
I removed both bndtools and the Google Eclipse plugin. Then I added just bndtools 2.3.0 from S3. That worked, at least I can work now... until I need to do some stuff in App Engine. For that I suppose I can have a separate Eclipse installation.

Dan

Dan Gravell

unread,
Aug 11, 2015, 5:21:50 AM8/11/15
to bndtools-users
Does anyone know if this restriction has been lifted, or we can change this to a warning?

This is (almost) a show stopper for me to move to bndtools 2.4 . I say almost because I think there's a workaround, but it's not one I fancy implementing.

Am I right in thinking the workaround is to move everything into a "src" folder, then have "normal" Eclipse folders for main/scala, main/java, main/resources, main/web (whatever actual source folders you have), then "Include" each one of those in the build path? i.e. manage it with exclusions, rather than source folders?

Dan

Adam Purkiss

unread,
Aug 11, 2015, 7:08:42 AM8/11/15
to bndtool...@googlegroups.com

Its still there. I have left the error in and eclipse and ant seem to work fine so I left it alone. I really wish it was a warning but they never did change it and I think it only get worse with the next release after that, but I have to update because they have bug fixes needed for some .Net mapping stuff I needed to pull in

--
You received this message because you are subscribed to a topic in the Google Groups "bndtools-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bndtools-users/UNL5Pr5SElE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bndtools-user...@googlegroups.com.

Dan Gravell

unread,
Aug 11, 2015, 7:13:27 AM8/11/15
to bndtools-users
Thanks. Does the generated/JAR still get generated then? I thought an Eclipse "error" marker would stop bndtools generating that.

Dan

Adam Purkiss

unread,
Aug 11, 2015, 7:16:27 AM8/11/15
to bndtool...@googlegroups.com

For me at least it seems eclipse still generates something. Although I have a bunch of project and build stuff in the bnd file.

BJ Hargrave

unread,
Aug 11, 2015, 8:43:15 AM8/11/15
to bndtool...@googlegroups.com
In bndtools 3.0 you can have multiple src folders. Prior to bndtools 3.0, eclipse can have multiple src folders but the headless build would only support a single src folder. Hence the warning.

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.
--
--
BJ

Dan Gravell

unread,
Aug 11, 2015, 9:45:54 AM8/11/15
to bndtools-users
Error... not warning... right?

Adam Purkiss

unread,
Aug 11, 2015, 9:58:10 AM8/11/15
to bndtool...@googlegroups.com

Yes, big fat red error. My opinion has always been to make it a warning or make it like the rest of eclipse where you can change it to what you want so I can choose what to do. By making it a warning it would help me not miss real errors with my bnd files

BJ Hargrave

unread,
Aug 11, 2015, 10:05:38 AM8/11/15
to bndtool...@googlegroups.com
I don't know since I am not at my workstation. In any case, it is not relevant anymore since bndtools 3.0 supports multiple src folders.

Peter Kriens

unread,
Aug 11, 2015, 1:33:52 PM8/11/15
to bndtool...@googlegroups.com
You can use -fixupmessages: <somepattern>;is:=warning to turn an error into a warning. If you use ignore instead of warning then the message is thrown away (this is the default). The pattern is using globbing. For example:

-fixupmessages.eclipse = ‘Too many Eclipse source sets defined’;is:=warning

Kind regards,

Peter Kriens

Dan Gravell

unread,
Aug 11, 2015, 2:32:32 PM8/11/15
to bndtools-users
Sounds interesting, I'll give it a try. Thanks!

Adam Purkiss

unread,
Aug 11, 2015, 3:46:28 PM8/11/15
to bndtool...@googlegroups.com

If it works for you please share what you did. I tried that flag in a number of spots but each time eclipse bndtools problem marker kept it visible so it did not work in my case. However I could just have it in the wrong spot.

Reply all
Reply to author
Forward
0 new messages