Hi Thomas,
I have been going through the same trauma as you with a fond attachment to the bnd workspace and a
dislike of maven.
I think you also have an interest in Vaadin. Vaadin has been the catalyst for me having to get to
know and use the new enRoute.
The ease of using Vaadin addons and the new Vaadin flow when using maven has made the journey to
date worthwhile.
Without a solid maven background it is bloody difficult and time consuming.
I am now finding that the maven process can be as convenient as the bnd workspace approach but still
with a few hiccups.
Stick with it, I am.
Note : R7 makes the whole OSGi process much better. DS forever, obliterate all previous internet
OSGi history :-)
Regards
Paul Fraser
On 1/02/2019 8:43 am, Thomas Driessen via osgi-dev wrote:
Hi Christian,
thanks for the advice. I've done this already and it works, but is obviously not as convenient as
using bndtools ;)
I thought that I could maybe use another IDE than Eclipse but without bndtools the development is
rather cumbersome :/
Bndtools adds so many awesome features that once you've used them you don't want to miss them in
another IDE ;)
But anyway, thanks for all your advices :)
Kind regards,
Thomas
Am Do., 31. Jan. 2019 um 18:17 Uhr schrieb Christian Schneider <ch...@die-schneider.net
<mailto:ch...@die-schneider.net>>:
What you can do is to export your project into a runnable jar using maven:
https://github.com/cschneider/osgi-ds-hello-world/blob/master/starter/pom.xml#L117-L169
So you simply do mvn clean package.
After that you can start it using:
java -jar <your jar>
This is not as convenient as bndtools but still not bad.
Christian
Am Do., 31. Jan. 2019 um 18:03 Uhr schrieb Thomas Driessen via osgi-dev
<osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>>:
Hi Tim,
thanks for your answer and the link. I will have a look into it :)
Is there any chance that something like a mvn bnd:run/debug command
(like mvn jetty:run)
will be implemented in the future?
This would be great if a user doesn't want to use Eclipse as IDE :)
Kind regards,
Thomas
------ Originalnachricht ------
Von: "Tim Ward" <tim.w...@paremus.com <mailto:tim.w...@paremus.com>>
An: "Thomas Driessen" <thomas.driessen...@gmail.com
<mailto:thomas.driessen...@gmail.com>>
Cc: "OSGi Developer Mail List" <osgi-dev@mail.osgi.org
<mailto:osgi-dev@mail.osgi.org>>
Gesendet: 31.01.2019 17:58:45
Betreff: Re: [osgi-dev] Move from bnd workspace to maven (enroute)
workspace
Hi Thomas,
The simple answer to your question is yes, however the more involved
answer is that you
probably shouldn’t. If you want to read up on ways to handle Maven
dependency management
then I can suggest looking at:
https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
This will talk you through how dependencies can be inherited from the
parent directly
(not usually a good idea), how versions of common dependencies can be
managed centrally
in a parent (usually a good idea), and how to construct a Bill Of
Materials (BOM) which
you can use as an easy way to grab a bunch of dependencies in one go
(much like OSGi
enRoute does with its indexes).
As for running directly from the command line. There isn’t an enRoute
or bnd plugin for
that, the smarts are all in Bndtools I’m afraid.
Best Regards,
Tim
On 31 Jan 2019, at 16:09, Thomas Driessen <thomas.driessen...@gmail.com
<mailto:thomas.driessen...@gmail.com>> wrote:
Hi Tim,
just to clarify (I'm not really used to maven yet):
If I want to define a dependency that is used by multiple sub modules,
then I MAY put
this dependency in the root/parent pom. I also COULD put this
dependency in each of the
sub module's poms which would have the same effect as the
aforementioned approach. I
don't need to define the dependecnies in both places.
Is this correct?
Regarding the running and reloading of applications in bndtools: I
don't use Eclipse,
therefore I asked if there are maven commands that mimc bndtools'
behavior ;)
Kind regards,
Thomas
------ Originalnachricht ------
Von: "Tim Ward" <tim.w...@paremus.com <mailto:tim.w...@paremus.com>>
An: "Thomas Driessen" <thomas.driessen...@gmail.com
<mailto:thomas.driessen...@gmail.com>>; "OSGi Developer Mail List"
<osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>>
Gesendet: 31.01.2019 16:48:54
Betreff: Re: [osgi-dev] Move from bnd workspace to maven (enroute)
workspace
Hi
On 31 Jan 2019, at 15:22, Thomas Driessen via osgi-dev
<osgi-dev@mail.osgi.org
<mailto:osgi-dev@mail.osgi.org>> wrote:
Hi,
I'm currently trying to get used to the new enroute maven workspace
layout and now
have some questions :)
1)
In a bnd workspace I had the central.xml file where I put all the
dependencies I
wanted in my local maven bnd worspace repository. Where do I put those
dependencies
now in the maven project workspace? In the dependencies section of the
root pom or
rather in the dependencies section of a specific module pom?
In this case you treat your dependencies just like you would in Maven.
If the
dependency is used across many modules then you might add it to the
dependencyManagement section of the parent pom (to manage the version
in a single
place), but you will always reference a dependency in the module using
it. There is
nothing special about this (it really is just vanilla Maven).
2)
In a bnd workspace I added the buildtime dependencies of a bundle to
its bnd file.
What's the best practice now in a maven workspace? Do I add those build
time
dependencies in the module pom?
Again, this is a normal Maven build that follows the same rules as all
the Maven
examples you can find on the internet. Your module’s compile time and
runtime
dependencies should be included in its pom, with the appropriate scope.
3)
In Eclipse with bndtools installed and when using a bnd workspace
layout I am able to
press the debug button of a bndrun file and everything is perfectly
integrated in the
IDE. Additionally, when I change code of bundles that are currently
running in an osgi
framework, then those are rebuilt and redeployed on the fly.
If you do the same thing in your enRoute workspace you’ll get the same
behaviour.
Is there a way to reproduce a similar behavior only with maven commands
and a remote
debugger?
You can start your application with remote debug enabled (just using
the normal JVM
debug arguments as you describe below) but I would recommend that you
just do the same
launching that you’ve been doing from a bad workspace.
Right now I'm following the enroute tutorial and every time I changed
something in the
code I type the following commands:
1 mvn -pl app -am bnd-indexer:index bnd-indexer:index@test-index
bnd-resolver:resolve
package
2 java -jar -Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y
.\app\target\app.jar
3 Then I start my remote debugger to attach to the jvm
Are there other maven commands that would me allow to skip step 2 and
3? Something
like mvn jetty:run for web apps?
There isn’t a Maven command for it, but if you look at the Eclipse
version of the
Running the Application
<https://enroute.osgi.org/tutorial/020-tutorial_qs.html#running-the-application>
section
in the enRoute tutorials you can see how to run inside the IDE.
Best Regards,
Tim
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev