In my previous working project in eclipse (before starting to use Maven) I had:
src/META-INF/jdoconfig.xml
In Maven I have:
src/main/resources/META-INF/jdoconfig.xml
I cannot work out how to tell eclipse to use this jdoconfig.xml file and as such when I launch the run configuration, it runs fine, but when I try to do anything that accesses my local datastore:
war/WEB-INF/appengine-generated/local_db.bin
then I try to run it I get the following error, I have no idea what to do to fix it!:
Caused by: javax.jdo.JDOFatalUserException: A property named javax.jdo.PersistenceManagerFactoryClass must be specified, or a jar file with a META-INF/services/javax.jdo.PersistenceManagerFactory entry must be in the classpath, or a property named javax.jdo.option.PersistenceUnitName must be specified. NestedThrowables: javax.jdo.JDOUserException: You have either specified for this PMF to use a "persistence-unit" of "transactions-optional" (yet this doesnt exist!) or you called JDOHelper.getPersistenceManagerFactory with "transactions-optional" as the name of a properties file (and this doesnt exist in the CLASSPATH) at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:856)
The issue is that the Appengine Eclipse plugin does a bit of work in the background that we want to migrate to Maven, in preparation for migrating some other stuff (to Firebase, because the Channel API is reaching end-of-life).
Currently I'm trying to use the org.datanucleus maven-datanucleus-plugin, and it is failing with an error saying that the filename (in the command that starts datanucleus in the plugin):
On
mvn -X installthis is where it stops: ...
[DEBUG] Executing command line: [DEBUG] cmd.exe /X /C "java -cp "C:\Users\john\.m2\repository\org\datanucleus\maven-datanucleus-plugin\3.2.0...
and then pages upon pages of all the .m2 contents plus all the .class files in the project, and so on.
Error while executing the DataNucleus tool 'org.datanucleus.enhancer.DataNucleusEnhancer'.: Error while executing process. Cannot run program "cmd.exe": CreateProcess error=206, The filename or extension is too long -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.datanucleus:maven-datanucleus-plugin:3.2.0-m1:enhance (default) on project DiaryBooker: Error while executing the DataNucleus tool 'org.datanucleus.enhancer.DataNucleusEnhancer'.
Not sure if this is expected behaviour of the datanucleus plugin (to use such a long classpath); I'm not even sure if I'm using the right plugin.