Hi Team, I am trying to test the `graphql-kotlin-m...
# graphql-kotlin
a
Hi Team, I am trying to test the
graphql-kotlin-maven-plugin
locally, I build it's jar and installed it into local maven and updated the version in my service but getting below error
Copy code
Execution default of goal com.expediagroup:graphql-kotlin-maven-plugin:8.0.0-SNAPSHOT:generate-sdl failed: A required class was missing while executing com.expediagroup:graphql-kotlin-maven-plugin:8.0.0-SNAPSHOT:generate-sdl: kotlin/jvm/functions/Function0
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.expediagroup:graphql-kotlin-maven-plugin:8.0.0-SNAPSHOT
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/amaagarwal/.m2/repository/com/expediagroup/graphql-kotlin-maven-plugin/8.0.0-SNAPSHOT/graphql-kotlin-maven-plugin-8.0.0-SNAPSHOT.jar
[ERROR] Number of foreign imports: 1
Can someone help, if there is another way to test it?
d
did you figure it out?
are you pointing to the latest
master
?
a
No, It's on my feature branch and from my feature branch I generated the snapshot version to test the changes by running
gradle clean build
and import that jar in .m2 folder and updated that snapshot version in my repo but still getting the same issue.
d
how are you running it?
./gradlew clean build
from root should work
a
I am running it from my service.
Copy code
<build>
        <finalName>${project.artifactId}</finalName>
        <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
        <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>com.expediagroup</groupId>
                <artifactId>graphql-kotlin-maven-plugin</artifactId>
                <version>8.0.0-SNAPSHOT</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate-sdl</goal>
                        </goals>
                        <configuration>
                            <packages>
                                <package>com.expediagroup.supply.api.lodging.reviews.schema.external</package>
                            </packages>
                            <schemaFile>${project.build.directory}/schema.graphql</schemaFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
This is my plugin configuration
It’s a maven project
and from graphql-kotlin library I tried with
Copy code
./gradlew clean build
Which generated the jar of every module and I imported that jar with below command
Copy code
mvn install:install-file \
   -Dfile=<path-to-file> \
   -DgroupId=<group-id> \
   -DartifactId=<artifact-id> \
   -Dversion=<version> \
   -Dpackaging=<packaging> \
   -DgeneratePom=true
and when I am running
Copy code
mvn clean install
At that time I am getting this error.
d
so gradle won't publish the JAR by default (as there is no need for it)
if you do
Copy code
./gradlew publishToMavenLocal
then you will get the artifacts deployed to your m2 repo so you can reference it from your other project
i'm guessing there is some transitive dependency that is missing and causing your failure
a
Let me give it a try, previously after building the jar from
gradle clean build
I was publishing it using
Copy code
mvn install:install-file \
   -Dfile=<path-to-file> \
   -DgroupId=<group-id> \
   -DartifactId=<artifact-id> \
   -Dversion=<version> \
   -Dpackaging=<packaging> \
   -DgeneratePom=true
Let me give it a try.
d
you would need to manually publish ALL other projects
*also I'd personally recommend to switch out to Gradle as it is much more powerful but thats a personal preference (you would still need to publish to local m2 to reference the artifacts.... or you could do a composite build that references other project, for simplicity I'd just run
publishToMavenLocal
)
👍 1
a
It worked, Thanks Derek for helping on the same. Your guess was correct it was due to the transitive dependencies.
Hi Derek, I saw our changes are merged to master https://github.com/ExpediaGroup/graphql-kotlin/commit/862460e26e8dc6ddf3a4265b51a06b153c21b63b Generally how much time it takes in publishing the new version?
d
It depends
I believe Sam is working on graphql java (breaking) update so I'd assume once he is done he'll release it
a
Got it, This change actually was blocking my team to get the schema changes done & merged. It would be helpful, if these changes are available for us.
d
I'd recommend to work with Sam on the schedule
a
May I ping him personally? Or is there any release channel which we have?
d
@Samuel Vazquez ⬆️
a
Thanks
s
would this be a breaking change ? if not we can cherry pick it
d
Technically it does change behavior in a very bery fringe case
ie IFF they apply location = input AND they provide custom name BUT rely on auto suffix then they would get different type name
Ie
Copy code
@GraphQLValidLocation([INPUT])
@GraphQLName("Bar")
data class Foo(...)
Old = BarInput New = Bar
You could argue that this is a fix though
s
yea, then will cherry pick it to v7 and v6
similar to the kotlinx ID scalar fix
a
Thanks Sam & Derek. How much time this cherry pick process takes? I could communicate my team accordingly.
s
it takes a command
Copy code
git cherry-pick
a
😄
d
Once merged and released please update v6 and v7 docs on master
a
Thanks Derek & Sam for your active support I was able to execute and test the changes and they are working fine after deployment.
s
will update our internal sdk with this new version of graphql-kotlin so you dont have to override the generation version
👍 1