If you don't want end to up in a huge bundle containing all these third party libraries (org.apache.* ...) you should define optional dependencies (e.g. I don't see any need to have a strict dependency on org.apache.ant). Other dependencies are available as OSGi bundles you should refer to. If you do that you will get a valid Neo4j OSGi 2.0 bundle of about 16-18MB and there is room for improvement. If you do not want to re-invent the wheel you can use this https://github.com/BluWings/neo4j-osgi-bundle Maven Project. It will produce an OSGi bundle you can deploy into your OSGi runtime (using Eclipse target platform or whatever)
Regards, Lars Am Mittwoch, 15. Januar 2014 23:01:31 UTC+1 schrieb Georg Summer: > > I used the /lib of the community edition. I added all the libs as a maven > dependency and if I try to deploy the app I get the following missing > dependency: > package=ch.qos.logback.classic. > > If I add the dependency for this lib I get the next dependency missing and > so on and so on. > When it started to ask me for org.apache.ant and javax.servlet I gave up. > There has to be a better way. > Anyone experience in deploying neo4j as a 3rd party dependency of an OSGi > bundle? > > On Wednesday, 15 January 2014 17:07:20 UTC+1, Peter Neubauer wrote: >> >> Hi Georg, >> Cytoscape not correctly resolving dependencies looks cumbersome. Do you >> know what more dependencies there could be? You can always download a >> server neo4j distribution, look into the /lib directory there and add all >> of these? >> >> /peter >> >> >> G: neubauer.peter >> S: peter.neubauer >> P: +46 704 106975 >> L: http://www.linkedin.com/in/neubauer >> T: @peterneubauer >> >> Neo4j 2.0.0 - >> (graphs)-[:FOR]->(everyone)<http://blog.neo4j.org/2013/12/neo4j-20-ga-graphs-for-everyone.html> >> Do something useful - Teach your kids 1 hour code!<http://code.org/learn> >> >> >> On Wed, Jan 15, 2014 at 5:02 PM, Georg Summer <[email protected]>wrote: >> >>> Neo4j Version: 2.0.0 >>> Cytoscape Version: 3.0.1 >>> Maven: 3.1.1 >>> Java: 1.7.0_45 OpenJDK Runtime Environment (IcedTea 2.4.3) (ArchLinux >>> build 7.u45_2.4.3-1-x86_64) >>> Eclipse: 4.3.1 >>> >>> >>> GOAL: The goal is to create an app for cytoscape 3.x (curr 3.0.1) that >>> is able to connect to an instance of neo4j. >>> >>> APPROACH: >>> 1. create a cytoscape 3.0.1 app based on the cytoscape tutorial from >>> http://opentutorials.cgl.ucsf.edu/index.php/Tutorial:Create_a_Bundle_App_Using_IDE >>> 2. make some menu entry that uses the EmbeddedGraphDatabaseService to >>> connect to an instance. >>> 3. add neo4j dependency to the pom.xml of the app >>> >>>> <dependency> >>>> <groupId>org.neo4j</groupId> >>> >>> <artifactId>neo4j</artifactId> >>>> <version>2.0.0</version> >>>> </dependency> >>> >>> 4. mvn clean install >>> 5. launch the app in Cytoscape >>> >>> RESULT: >>> Cytoscape 3 can not resolve the dependency and the app will not start. >>> >>> Suggested FIX 1: >>> http://wiki.cytoscape.org/Cytoscape_3/AppDeveloper/Cytoscape_3_App_Cookbook#Embedding_Dependencies >>> Use <Embed-Dependency> >>> >>>> <!-- Generates the OSGi metadata based on the osgi.bnd file. --> >>>> <plugin> >>>> <groupId>org.apache.felix</groupId> >>>> <artifactId>maven-bundle-plugin</artifactId> >>>> <version>2.3.7</version> >>>> <extensions>true</extensions> >>>> <configuration> >>>> <instructions> >>>> <Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName> >>>> <Bundle-Version>${project.version}</Bundle-Version> >>>> <Export-Package>${bundle.namespace}</Export-Package> >>>> <Private-Package>${bundle.namespace}.internal.*</Private-Package> >>>> >>>> <Bundle-Activator>${bundle.namespace}.internal.CyActivator</Bundle-Activator> >>>> <!-- <Embed-Dependency>neo4j*;scope=compile|runtime</Embed-Dependency> >>>> --> >>>> <!-- <Embed-Transitive>true</Embed-Transitive> --> >>>> </instructions> >>>> </configuration> >>>> </plugin> >>> >>> >>> RESULT: While a neo4j jar is put into the app, the neo4j jar is empty >>> and does not resolve the dependencies. >>> >>> Naive Fix 2: >>> Normally one has to add more than one lib to the eclipse project. So I >>> tried that. >>> >>>> <dependency> >>>> <groupId>org.neo4j</groupId> >>>> <artifactId>neo4j-udc</artifactId> >>>> <version>2.0.0</version> >>>> </dependency> >>>> <dependency> >>>> <groupId>org.neo4j</groupId> >>>> <artifactId>neo4j-kernel</artifactId> >>>> <version>2.0.0</version> >>>> </dependency> >>>> <dependency> >>>> <groupId>org.neo4j</groupId> >>>> <artifactId>neo4j-lucene-index</artifactId> >>>> <version>2.0.0</version> >>>> </dependency> >>>> <dependency> >>>> <groupId>org.neo4j</groupId> >>>> <artifactId>neo4j-graph-algo</artifactId> >>>> <version>2.0.0</version> >>>> </dependency> >>> >>> >>> And so on. Embedding them as suggested in Fix 1 as well. >>> >>>> >>>> <Embed-Dependency>lucene-core,geronimo-jta_1.1_spec,scala-library,neo4j*,parboiled-scala_2.10,parboiled-core,concurrentlinkedhashmap-lru;scope=compile|runtime</Embed-Dependency> >>> >>> >>> All these sources are then included in the jar and when I deploy the app >>> in Cytoscape are recognized. >>> Why does it not fix the problem? Well Cytoscape demands more >>> dependencies. At the point of of it asking for org.apache.ant and javax.jms >>> I stopped. >>> The <Embed-Transitive>true</Embed-Transitive> directive should take care >>> of that. >>> >>> >>> So I am a bit stuck. Does anyone have an idea how to make an Cytoscape 3 >>> App depending on Neo4j? >>> >>> >>> Georg >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Neo4j" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
