Giter Club home page Giter Club logo

Comments (13)

kishores avatar kishores commented on August 22, 2024 1

Yes Yoichiro - your assessment is on point. I am looking at a solution where I mark the dependency on libactions_lib_java and libdialogflow_lib_java as "provided" as it is provided in the actions-on-google library jar file. Should have an update on this soon.

from actions-on-google-java.

kishores avatar kishores commented on August 22, 2024 1

This is fixed in MavenCentral. Source will be pushed to github along with the next patch release.

from actions-on-google-java.

IanSmith1337 avatar IanSmith1337 commented on August 22, 2024

Also, I found that it compiles right if you have the dependency as a system scope with the jar in the project folder, like this:

<dependency>
        <groupId>com.google.actions</groupId>
              <artifactId>actions-on-google</artifactId>
              <version>1.0.0</version>
              <scope>system</scope>
              <systemPath> /Users/(YourUsername)/Documents/Coding/Java/Projects/HabitGame/actions-on-google-1.0.0.jar</systemPath>
     </dependency>

from actions-on-google-java.

yoichiro avatar yoichiro commented on August 22, 2024

I have same problem on my simple project. In my pom.xml file, a compiling is successful. However, for example, when launching of Jetty server with jetty-maven-plugin and sending a first request, a ClassNotFoundException is thrown.

Caused by: java.lang.ClassNotFoundException: kotlin.TypeCastException
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239)
    at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass (WebAppClassLoader.java:556)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:521)
...

When I confirmed my maven local repository at this time, I could not find org.jetbrains.kotlin:kotlin-stdlib library and other dependent libraries in my repository. That is, my maven task could not download these dependent libraries because the pom.xml in the AoG Java/Kotlin Client Library is invalid, I guess.

There are some sample projects in the actions-on-google GitHub organization. However, all projects use Gradle. not Maven. Well, I guess that this library was released without any tests on Maven.

My pom.xml file is: https://gist.github.com/yoichiro/da973424eb957626fba7ca88611a6c40

from actions-on-google-java.

kishores avatar kishores commented on August 22, 2024

We are looking into this. Will post back results here.

from actions-on-google-java.

yoichiro avatar yoichiro commented on August 22, 2024
[ERROR] 'dependencies.dependency.systemPath' for com.google.actions.v2:google-actions-bindings:jar must specify an absolute path but
is ${project.basedir}/lib/libactions_java_lib.jar @
[ERROR] 'dependencies.dependency.systemPath' for com.dialogflow.bindings:dialogflow-bindings:jar must specify an absolute path but 
is ${project.basedir}/lib/libdialogflow_java_lib.jar @ 

Basically, I think that the cause is that the current implementation refers two jar files (libactions_java_lib.jar and libdialogflow_lib_java.jar) using the "system" scope at the following definitions:

    <dependency>
      <groupId>com.google.actions.v2</groupId>
      <artifactId>google-actions-bindings</artifactId>
      <version>1.0</version>
      <scope>system</scope>
      <systemPath>${project.basedir}/lib/libactions_java_lib.jar
      </systemPath>
    </dependency>
    <dependency>
      <groupId>com.dialogflow.bindings</groupId>
      <artifactId>dialogflow-bindings</artifactId>
      <version>1.0</version>
      <scope>system</scope>
      <systemPath>${project.basedir}/lib/libdialogflow_java_lib.jar
      </systemPath>
    </dependency>

Actually, all classes of these two library are included into the actions-on-google-1.0.0.jar file by the following definition:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.6</version>
        <executions>
          <execution>
            <id>prepare</id>
            <phase>validate</phase>
            <configuration>
              <tasks>
                <echo message="prepare phase"/>
                <unzip dest="target/classes"
                  src="${project.basedir}/lib/libactions_java_lib.jar"/>
                <unzip dest="target/classes"
                  src="${project.basedir}/lib/libdialogflow_java_lib.jar"/>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

That is, actually the two "dependency" definitions above are NOT necessary. At least, they should not be included in the updated pom.xml file to Maven Central repository.

To solve this situation, I guess that there are the following solutions:

  1. If the two libraries (libactions_lib_java.jar and libdialogflow_lib_java.jar) can be registered as each independent library to Maven central repository, the actions-on-google-java library can refer them without using the "system" scope. This is a good solution in the case that you don't want to publish these source files.
  2. If you can publish these source files, they can be included in the src directory instead to refer the two jar files.
  3. If you want to not change anything, you can specify a customized pom.xml file (that doesn't have the two dependency definitions with the "system" scope) at deploying to Maven Central repository. https://maven.apache.org/plugins/maven-deploy-plugin/examples/deploying-with-customed-pom.html

My recommendation is 1 or 2.

from actions-on-google-java.

kishores avatar kishores commented on August 22, 2024

I have fixed the pom.xml on MavenCentral. Can you please try using the 1.0.1 version as shown below?

<dependency>
	<groupId>com.google.actions</groupId>
	<artifactId>actions-on-google</artifactId>
	<version>1.0.1</version>
	<type>pom</type>
</dependency>

from actions-on-google-java.

yoichiro avatar yoichiro commented on August 22, 2024

@kishores Ok, I will test the new version. Give me a few hours.

from actions-on-google-java.

yoichiro avatar yoichiro commented on August 22, 2024

@kishores Great! The new version 1.0.1 works fine! I tested the following dependency definition:

<dependency>
	<groupId>com.google.actions</groupId>
	<artifactId>actions-on-google</artifactId>
	<version>1.0.1</version>
</dependency>

BTW, I think that the <type>pom</type> is unnecessary. Actually, if the type element specified, some errors occur (Compilation Failure).

from actions-on-google-java.

IanSmith1337 avatar IanSmith1337 commented on August 22, 2024

Okay, so @yoichiro, should the <type> tags be removed?

from actions-on-google-java.

yoichiro avatar yoichiro commented on August 22, 2024

should the tags be removed?

@TrianReallyHard Yes. The <type>pom</type> is used for specifying a BOM project.

from actions-on-google-java.

 avatar commented on August 22, 2024

Where would one be looking for these dependencies:

<dependency>
      <groupId>com.google.actions</groupId>
      <artifactId>actions-bindings</artifactId>
      <version>2.0.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.actions</groupId>
      <artifactId>dialogflow-bindings</artifactId>
      <version>2.0.0</version>
      <scope>provided</scope>
    </dependency>

They don't seem to be available on search.maven.org and instead went to sonatype repo as pointed here: https://stackoverflow.com/questions/54585915/which-jar-houses-com-google-api-services-actions-fulfillment-v2-model-packag. Why the inconsistency?

from actions-on-google-java.

Fleker avatar Fleker commented on August 22, 2024

Those two files should originate as jar files that are embedded in the library source, and aren't hosted directly on Maven.

from actions-on-google-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.