Unable to generate App Engine datastorecallbacks.xml using Maven - java

I am trying to migrate an existing App Engine app to Maven but I am running into a problem with generating datastorecallbacks.xml, so I tried to start a project from scratch using this tutorial: https://developers.google.com/appengine/docs/java/tools/maven and then added:
#PostPut(kinds = {"Greeting"})
void updateCache(PutContext context) {
Entity greeting = new Entity("Test", "test");
DatastoreService datastore =
DatastoreServiceFactory.getDatastoreService();
datastore.put(greeting);
}
The full source code can be found here: https://github.com/bogdan-nourescu/AppEngineMavenTest
The build fails with this error message:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myapplication 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # myapplication ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Bogdan\IdeaProjects\test9\myapplication\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # myapplication ---
[INFO] Compiling 1 source file to C:\Users\Bogdan\IdeaProjects\test9\myapplication\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error: Datastore Callbacks: java.lang.RuntimeException: Unable to read META-INF/datastorecallbacks.xml
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.421s
[INFO] Finished at: Thu Jan 16 13:41:43 EET 2014
[INFO] Final Memory: 17M/216M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project myapplication: Compilation failure
[ERROR] error: Datastore Callbacks: java.lang.RuntimeException: Unable to read META-INF/datastorecallbacks.xml
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
What am I missing in the pom.xml that will correctly generate the datastorecallbacks.xml?

Related

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project Eclipse

--- maven-clean-plugin:3.1.0:clean (default-clean) # Homework5 ---
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) # Homework5 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/vintage/eclipse-workspace/Homework5/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) # Homework5 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /Users/vintage/eclipse-workspace/Homework5/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.281 s
[INFO] Finished at: 2022-03-19T00:14:48-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project Homework5: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Unable to run my code for a homework assignment. It says that " No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK" but I'm unsure on how to fix that issue.
Running Mac OSX Monterey 12.2
Eclipse IDE 2022-03
Tomcat Apache 9

Executing Project through Maven Invoker is throwing a compilation error

I am trying to execute the maven project from java main
Please refer the code below.
public static void main(String args[]) throws MavenInvocationException
{
InvocationRequest request = new DefaultInvocationRequest();
request.setPomFile( new File( "C:\\Users\\DPKA764\\git\\be.axa.testautomation.phoenixiard\\pom.xml" ) );
request.setGoals( Arrays.asList( "clean", "install" ) );
Invoker invoker = new DefaultInvoker();
invoker.setMavenHome(new File("C:\\J\\apache-maven-3.5.3"));
System.out.println(""+invoker.getMavenHome());
invoker.execute( request );
System.out.println("suites are completed");
}
and when i execute the code as 'Java Application' it is throwing the following error.
[WARN] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< be.axa.PhoenixIARD:PhoenixIARD >-------------------
[INFO] Building git-training 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) # PhoenixIARD ---
[INFO] Deleting C:\Users\DPKA764\git\be.axa.testautomation.phoenixiard\target
[INFO]
[INFO] --- properties-maven-plugin:1.0.0:read-project-properties (default) # PhoenixIARD ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # PhoenixIARD ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\DPKA764\git\be.axa.testautomation.phoenixiard\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # PhoenixIARD ---
[INFO] Compiling 57 source files to C:\Users\DPKA764\git\be.axa.testautomation.phoenixiard\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Unable to locate the Javac Compiler in:
C:\Program Files\Java\jre7\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.885 s
[INFO] Finished at: 2020-02-03T18:24:34+05:30
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "metadata" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project PhoenixIARD: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files\Java\jre7\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
but when i execute the project directly as Maven Test It will run fine.Please suggest any changes i have to do

Java EE 8 tutorial - Maven archetype does not exist

I'm trying to do this tutorial from Java EE 8 tutorial.
I'm following the instructions on how to install tutorial archetypes, which I've downloaded from this repository.
Error message printed in the bottom.
Is this related to the fact that the repository is archived, and the tutorials are outdated, or am I doing something wrong?
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.1.0:generate (default-cli) > generate-sources # standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.1.0:generate (default-cli) < generate-sources # standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:3.1.0:generate (default-cli) # standalone-pom ---
[INFO] Generating project in Batch mode
[WARNING] Archetype not found in any catalog. Falling back to central repository.
[WARNING] Add a repository with id 'archetype' in your settings.xml if archetype's repository is elsewhere.
[WARNING] The POM for org.glassfish.javaeetutorial:jaxrs-service-archetype:jar:4.0.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.765 s
[INFO] Finished at: 2019-06-10T20:16:02+02:00
[INFO] Final Memory: 15M/195M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.0:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.glassfish.javaeetutorial:jaxrs-service-archetype:4.0.0) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Failed to execute goal on project Siafu: Could not resolve dependencies for project Siafu:Siafu:jar:1.0.6-SNAPSHOT

Siafu is a context simulator
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] MavenParent ........................................ SUCCESS [ 0.004 s]
[INFO] Siafu Simulator .................................... FAILURE [01:27 min]
[INFO] Siafu datatypes library ............................ SKIPPED
[INFO] Simulation-Glasgow ................................. SKIPPED
[INFO] Simulation-Leimen .................................. SKIPPED
[INFO] Simulation-Office .................................. SKIPPED
[INFO] Simulation-Testland ................................ SKIPPED
[INFO] Simulation-Valencia ................................ SKIPPED
[INFO] Simulations ........................................ SKIPPED
[INFO] SiafuAggregator .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:27 min
[INFO] Finished at: 2017-04-24T15:45:12+08:00
[INFO] Final Memory: 10M/91M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Siafu: Could not resolve dependencies for project Siafu:Siafu:jar:1.0.6-SNAPSHOT:
Failed to collect dependencies at org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:3.8:
Failed to read artifact descriptor for org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:jar:3.8:
Could not transfer artifact org.eclipse.swt:org.eclipse.swt.gtk.linux.x86:pom:3.8 from/to swt-repo (https://swt-repo.googlecode.com/svn/repo/): Network is unreachable (connect failed) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf
Please give me some help to solve this problem,thanks!

Maven : Getting compilation error using the Install command through cmd

Compilation error on using Maven Install command
Hi , When I use the Maven clean command it runs successfully but when I run the install command , I have been getting compilation errors . Follwing is the error I have been getting.Thanks
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TigerFinal 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # TigerFinal ---
[INFO] Deleting C:\Users\Shashank_bisht\workspace\TigerFinal\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.517 s
[INFO] Finished at: 2016-01-04T22:53:12+05:30
[INFO] Final Memory: 6M/105M
[INFO] ------------------------------------------------------------------------
C:\Users\Shashank_bisht\workspace\TigerFinal>mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TigerFinal 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # TigerFinal ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Shashank_bisht\workspace\TigerFinal\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # TigerFinal ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 11 source files to C:\Users\Shashank_bisht\workspace\TigerFinal\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/Shashank_bisht/workspace/TigerFinal/src/main/java/tiger/MyHomepage/Home.java:[11,27] packa
MyHomepageTestCases does not exist
[ERROR] /C:/Users/Shashank_bisht/workspace/TigerFinal/src/main/java/tiger/Utils/AppUtils.java:[14,27] packag
yHomepageTestCases does not exist
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.733 s
[INFO] Finished at: 2016-01-04T22:53:26+05:30
[INFO] Final Memory: 17M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
project TigerFinal: Compilation failure: Compilation failure:
[ERROR] /C:/Users/Shashank_bisht/workspace/TigerFinal/src/main/java/tiger/MyHomepage/Home.java:[11,27] packa
MyHomepageTestCases does not exist
[ERROR] /C:/Users/Shashank_bisht/workspace/TigerFinal/src/main/java/tiger/Utils/AppUtils.java:[14,27] packag
yHomepageTestCases does not exist
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
From the comments:
You need a full JDK (Java Development Kit), not a JRE (Java Runtime Environment)
Download a JDK from OpenJDK or Oracle, then set the environment variable JAVA_HOME to the root folder of your JDK.
Then re-try your Maven command

Categories