Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying neo4j from java as follows:

Java
import org.neo4j.graphdb.GraphDatabaseService;
    import org.neo4j.graphdb.Label;
    import org.neo4j.graphdb.Node;
    import org.neo4j.graphdb.Transaction;
    import org.neo4j.graphdb.factory.GraphDatabaseFactory;   
    public class tests {   
    public enum nodetype implements Label
    {
    Student,teacher;
    }
    public static void main(String[] args) {
    GraphDatabaseFactory dbfactory=new GraphDatabaseFactory();
    GraphDatabaseService graphdb =dbfactory.newEmbeddedDatabase("C:\\Users\\Zigzago\\.Neo4jDesktop\\neo4jDatabases\\database-f308fc06-68df-4463-841d-fb3ab98b1b08\\installation-3.3.3\\data\\databases\\graph.db");
    try(Transaction tx=graphdb.beginTx())
    {  
    Node s= graphdb.createNode(nodetype.Student);
    s.setProperty("Pid",5001);
    tx.success();
    }
    catch (Exception ex)
    {
    String message = ex.getMessage();
    }
    graphdb.shutdown();
    }    
    }


and pom.xml is

XML
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelversion>4.0.0
    <groupid>com.mycompany
    <artifactid>neo4jtest
    <version>1.0-SNAPSHOT
    <packaging>jar
    <properties>
        <project.build.sourceencoding>UTF-8
        <maven.compiler.source>1.8
        <maven.compiler.target>1.8
    
    <dependencies>
        <dependency>
            <groupid>org.neo4j
            <artifactid>neo4j
            <version>2.1.6

but i get the following error:
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project neo4jtest: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles: [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

knowing that iam using netbeans8.1 with jdk : java version "1.8.0_144"

What I have tried:

netbeans8.1 with jdk : java version "1.8.0_144"
Posted
Updated 24-Apr-18 16:54pm
v4
Comments
Richard MacCutchan 25-Apr-18 4:00am    
You need to do what the error messages suggest in order to collect more information.
zigzagooo 25-Apr-18 18:26pm    
i am new to java how to re-run maven with -x option?
Richard MacCutchan 26-Apr-18 2:50am    
zigzagooo 28-Apr-18 4:15am    
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 15:51:
28+0200)
Maven home: C:\Program Files\NetBeans 8.1\java\maven\bin\..
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_60\jre
Default locale: en_US, platform encoding: Cp1256
OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "dos"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from C:\Program Files\NetBeans 8.1\java\maven\bi
n\..\conf\settings.xml
[DEBUG] Reading user settings from C:\Users\Zigzago\.m2\settings.xml
[DEBUG] Using local repository at C:\Users\Zigzago\.m2\repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:\Use
rs\Zigzago\.m2\repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project org.apache.maven:standalone-pom:pom:1: (non
e)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.co
re, parent: null]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.141s
[INFO] Finished at: Sat Apr 28 10:04:56 EET 2018
[INFO] Final Memory: 4M/77M
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid li
fecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id
>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are
: validate, initialize, generate-sources, process-sources, generate-resources, p
rocess-resources, compile, process-classes, generate-test-sources, process-test-
sources, generate-test-resources, process-test-resources, test-compile, process-
test-classes, test, prepare-package, package, pre-integration-test, integration-
test, post-integration-test, verify, install, deploy, pre-site, site, post-site,
site-deploy, pre-clean, clean, post-clean. -> [Help 1]
org.apache.maven.lifecycle.NoGoalSpecifiedException: No goals have been specifie
d for this build. You must specify a valid lifecycle phase or a goal in the form
at <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-ver
sion>]:<goal>. Available lifecycle phases are: validate, initialize, generate-so
urces, process-sources, generate-resources, process-resources, compile, process-
classes, generate-test-sources, process-test-sources, generate-test-resources, p
rocess-test-resources, test-compile, process-test-classes, test, prepare-package
, package, pre-integration-test, integration-test, post-integration-test, verify
, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, pos
t-clean.
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:104)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classwor
Richard MacCutchan 28-Apr-18 4:23am    
Quote:[ERROR] No goals have been specified for this build. You must specify a valid li
fecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id
>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are
: validate, initialize, generate-sources, process-sources, generate-resources, p
rocess-resources, compile, process-classes, generate-test-sources, process-test-
sources, generate-test-resources, process-test-resources, test-compile, process-
test-classes, test, prepare-package, package, pre-integration-test, integration-
test, post-integration-test, verify, install, deploy, pre-site, site, post-site,
site-deploy, pre-clean, clean, post-clean. -> [Help 1]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900