googleapis / google-oauth-java-client

Google OAuth Client Library for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compile not possible

ThomasBroehm opened this issue · comments

My goal is to get the example running. I am starting from scratch just following the given instructions for the dailymotion-cmdline-sample:
git clone https://github.com/google/google-oauth-java-client.git
cd google-oauth-java-client/samples/dailymotion-cmdline-sample

mvn compile
==> result is:
C:\src\google\google-oauth-java-client\samples\dailymotion-cmdline-sample>mvn compile
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO]
[INFO] -----< com.google.oauth-client:dailymotion-simple-cmdline-sample >------
[INFO] Building Example for the DailyMotion API using OAuth2. 1.31.5-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for com.google.oauth-client:google-oauth-client:jar:1.31.5-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.google.oauth-client:google-oauth-client-java6:jar:1.31.5-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for com.google.oauth-client:google-oauth-client-jetty:jar:1.31.5-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.400 s
[INFO] Finished at: 2021-01-25T13:38:17+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project dailymotion-simple-cmdline-sample: Could not resolve dependencies for project com.google.oauth-client:dailymotion-simple-cmdline-sample:jar:1.31.5-SNAPSHOT: The following artifacts could not be resolved: com.google.oauth-client:google-oauth-client:jar:1.31.5-SNAPSHOT, com.google.oauth-client:google-oauth-client-java6:jar:1.31.5-SNAPSHOT, com.google.oauth-client:google-oauth-client-jetty:jar:1.31.5-SNAPSHOT: Could not find artifact com.google.oauth-client:google-oauth-client:jar:1.31.5-SNAPSHOT -> [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
C:\src\google\google-oauth-java-client\samples\dailymotion-cmdline-sample>

OS is Windows 10, JDK 1.8.0_271
So it seems that there is some preliminary work todo before running the example is possible. Maybe somebody could be so kind and give some light into my darkness ?
Thank you.
Thomas

since you're using snapshots from head, you need to mvn clean install locally before trying to compiole the sample.

after running command mvn clean install from ./google-oauth-java-client directory I get this one; would be great if you could help me again!

[...]

C:\Users\ThomasB.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar
Errors were encountered when loading the specified MetaData files and classes. See the nested exceptions for details
DataNucleus Enhancer completed with an error. Please review the enhancer log (at DEBUG level) for full details. Some classes may have been enhanced but some caused errors

[ERROR] --------------------
[ERROR] Standard error from the DataNucleus tool + org.datanucleus.enhancer.DataNucleusEnhancer :
[ERROR] --------------------
[ERROR] log4j:WARN No appenders could be found for logger (DataNucleus.General).
log4j:WARN Please initialize the log4j system properly.
Error reading the Meta-Data input "Content ist nicht zulässig in Prolog.
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content ist nicht zulässig in Prolog.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:994)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataStream(MetaDataParser.java:276)
at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataURL(MetaDataParser.java:137)
at org.datanucleus.api.jdo.metadata.JDOMetaDataManager.parseFile(JDOMetaDataManager.java:239)
at org.datanucleus.metadata.MetaDataManager.loadFiles(MetaDataManager.java:1227)
at org.datanucleus.metadata.MetaDataManager.loadMetadataFiles(MetaDataManager.java:463)
at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:752)
at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:513)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1281)
"
org.datanucleus.exceptions.NucleusException: Error reading the Meta-Data input "Content ist nicht zulässig in Prolog.
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content ist nicht zulässig in Prolog.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:994)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataStream(MetaDataParser.java:276)
at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataURL(MetaDataParser.java:137)
at org.datanucleus.api.jdo.metadata.JDOMetaDataManager.parseFile(JDOMetaDataManager.java:239)
at org.datanucleus.metadata.MetaDataManager.loadFiles(MetaDataManager.java:1227)
at org.datanucleus.metadata.MetaDataManager.loadMetadataFiles(MetaDataManager.java:463)
at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:752)
at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:513)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1281)
"
at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataStream(MetaDataParser.java:303)
at org.datanucleus.metadata.xml.MetaDataParser.parseMetaDataURL(MetaDataParser.java:137)
at org.datanucleus.api.jdo.metadata.JDOMetaDataManager.parseFile(JDOMetaDataManager.java:239)
at org.datanucleus.metadata.MetaDataManager.loadFiles(MetaDataManager.java:1227)
at org.datanucleus.metadata.MetaDataManager.loadMetadataFiles(MetaDataManager.java:463)
at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:752)
at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:513)
at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1281)
Nested Throwables StackTrace:

[ERROR] --------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Parent for the Google OAuth Client Library for Java 1.31.5-SNAPSHOT:
[INFO]
[INFO] Parent for the Google OAuth Client Library for Java SUCCESS [ 3.114 s]
[INFO] Google OAuth Client Library for Java ............... SUCCESS [ 15.247 s]
[INFO] Servlet and JDO extensions to the Google OAuth Client Library for Java. FAILURE [ 1.956 s]
[INFO] Google App Engine extensions to the Google OAuth Client Library for Java. SKIPPED
[INFO] Google OAuth Client Library for Java BOM ........... SKIPPED
[INFO] Java 6 (and higher) extensions to the Google OAuth Client Library for Java. SKIPPED
[INFO] OAuth 2.0 verification code receiver for Google OAuth Client Library for Java. SKIPPED
[INFO] Example for the DailyMotion API using OAuth2. ...... SKIPPED
[INFO] Example for obtaining OAuth2 tokens with PKCE verification using the Authorization Code Flow against Keycloak. SKIPPED
[INFO] Assembly for the Google OAuth Client Library for Java SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.338 s
[INFO] Finished at: 2021-01-28T16:54:53+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.datanucleus:datanucleus-maven-plugin:4.0.5:enhance (default) on project google-oauth-client-servlet: The DataNucleus tool org.datanucleus.enhancer.DataNucleusEnhancer exited with a non-null exit code. -> [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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :google-oauth-client-servlet

C:\src\google\google-oauth-java-client>

You're hitting #217

The product does not currently build on Windows :-(

If you're just trying to compile and run the sample, change the -SNAPSHOT version to the latest, released version: https://search.maven.org/artifact/com.google.oauth-client/google-oauth-client. The google-oauth-client-servlet artifact build process does not work on windows, but the already compiled version should work fine on windows.