JanKoehnlein / FXDiagram

JavaFX diagram
Apache License 2.0
74 stars 21 forks source link

FXDiagram example using a non PDE (vanilla) maven build #50

Closed Hellblazer closed 8 years ago

Hellblazer commented 8 years ago

I'm having trouble getting FXDiagram to work in my non PDE maven build. I can successfully build the project and have published the maven jars. However, there are many dependencies that apparently are not included in pom's of the built artifacts. Apparently, the OSGi bundle dependencies are not picked up by the vanilla maven dependency mechanism.

I understand this has to do with the eclipse plugin. However, I'm curious as to how I work with this issue. Do you have a simple example of just running your demo from within a separate, generic, maven only build?

Appreciate any guidance you can provide.

JanKoehnlein commented 8 years ago

I haven't set up a complete maven only build yet. It's currently a mix of tycho (maven PDE) and various shell scripts. What I do for a full release: 1) Run update_versions.sh to set the current versions in all Manifests and poms 2) Run mvn clean install. This builds the Eclipse plug-ins and the PDE update-site. It also pre-collects the plug-in jars for the non-Eclipse version. 3) I run the promote.sh script which assembles everything into a directory which can be directly copied to bintray. This finishes the collection of the non-Eclipse jars in the binary folder. 4) I push the results to bintray using push_to_bintray.sh. This also makes a copy in a local git repo in case I have to restore older versions. This is necessary as bintray requires me to overwrite contents.jar and artifacts.jar with every new version.

I'd really like to get rid of step 3 and use tycho/maven only to collect the non-PDE jars, but I did not manage with a reasonable amount of effort and went for the provisional solution. Maybe you can help here...

I can give you further assistance on Tuesday when I am back to my computer.

Thanks for your efforts so far.

Cheers Jan

Von meinem iPhone gesendet

Am 14.05.2016 um 19:24 schrieb Constantine notifications@github.com:

I'm having trouble getting FXDiagram to work in my non PDE maven build. I can successfully build the project and have published the maven jars. However, there are many dependencies that apparently are not included in pom's of the built artifacts. Apparently, the OSGi bundle dependencies are not picked up by the vanilla maven dependency mechanism.

I understand this has to do with the eclipse plugin. However, I'm curious as to how I work with this issue. Do you have a simple example of just running your demo from within a separate, generic, maven only build?

Appreciate any guidance you can provide.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

Hellblazer commented 8 years ago

Ah. No problem.

I don't think I was clear. I have a successful maven build of the the FXDiagram (see https://github.com/Hellblazer/FXDiagram). This builds correctly, both locally and on my CI, producing the jars that are being used by another maven project of mine, which is unfortunately a private repository.

Thus, I have all of the maven artifacts built by the FXDiagram build available in my local maven repository.

Currently, I have a JavaFX application being built by maven (no tycho nor PDE). This works successfully, and there's no issue with that, of course. However, when I simply add the dependency to this separate project:

        <dependency>
            <groupId>de.fxdiagram</groupId>
            <artifactId>de.fxdiagram.core</artifactId>
            <version>0.27.3-SNAPSHOT</version>
        </dependency>

My FX application won't even start up. Note that my application does not use FXDiagram in any way. Rather, the above dependency is on the class path. Apparently, being on the class path is enough to make it hang - i.e. no window appears, application is not initialized. Undoubtedly, this is due to missing dependencies of some sort. And indeed, there are only xtend dependencies that are pulled in by adding the de.fxdiagram.core dependency to my module. When I look at the de.fxdiagram.core maven project in my eclipse IDE, I see a lot of PluginDependencies that are not included in my other project's dependencies.

I'm sure this is because my project does not have tycho set up correctly to resolve the additional dependencies of the bundle de.fxdiagram.core that are not present that artifact's pom. I am familiar with OSGi, but unfortunately not so much with eclipse plugins, nor with the maven tycho integration.

In any event, thank you for your help, and the wonderful project.

JanKoehnlein commented 8 years ago

Putting every jar you find in the fxdiagram-jars.zip as explicit dependencies should work. Maybe we need a second non-Eclipse build for setting up the dependencies correctly. Then we’d eventually be able to push FXDiagram to maven central.

Thanks for using FXDiagram. I am curious to learn what you’re doing with it. Don’t hesitate to propose enhancments, report bugs or even contribute fixes ;-)

Regards Jan

On 14 May 2016, at 20:14, Constantine notifications@github.com wrote:

Ah. No problem.

I don't think I was clear. I have a successful maven build of the the FXDiagram (see https://github.com/Hellblazer/FXDiagram). This builds correctly, both locally and on my CI, producing the jars that are being used by another maven project of mine, which is unfortunately a private repository.

Thus, I have all of the maven artifacts built by the FXDiagram build available in my local maven repository.

Currently, I have a JavaFX application being built by maven (no tycho nor PDE). This works successfully, and there's no issue with that, of course. However, when I simply add the dependency to this separate project:

    <dependency>
        <groupId>de.fxdiagram</groupId>
        <artifactId>de.fxdiagram.core</artifactId>
        <version>0.27.3-SNAPSHOT</version>
    </dependency>

My FX application won't even start up. Note that my application does not use FXDiagram in any way. Rather, the above dependency is on the class path. Apparently, being on the class path is enough to make it hang - i.e. no window appears, application is not initialized. Undoubtedly, this is due to missing dependencies of some sort. And indeed, there are only xtend dependencies that are pulled in by adding the de.fxdiagram.core dependency to my module. When I look at the de.fxdiagram.core maven project in my eclipse IDE, I see a lot of PluginDependencies that are not included in my other project's dependencies.

I'm sure this is because my project does not have tycho set up correctly to resolve the additional dependencies of the bundle de.fxdiagram.core that are not present that artifact's pom. I am familiar with OSGi, but unfortunately not so much with eclipse plugins, nor with the maven tycho integration.

In any event, thank you for your help, and the wonderful project.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

Hellblazer commented 8 years ago

Okay, I got this to work by checking in the de.cau.cs.kieler group as system path dependencies and adding the rest of the dependencies manually. Not the best solution, but works for my use case as I'm packing everything into one shaded jar.

Also figured out the eclipse hang. There's a check box on the run configuration for the -xstartOnFirstThread thing for SWT. Unchecking that solved the hang.

Thanks!