Skip to content

Commit d077e30

Browse files
Added site documentation for new parameter copyGraphQLJavaSources
1 parent f76435f commit d077e30

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

src/site/apt/runtimeclasses.apt.vm

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
------------------------------------------
2+
GraphQL Maven Plugin (client mode)
3+
------------------------------------------
4+
------------------------------------------
5+
------------------------------------------
6+
7+
8+
Runtime Classes
9+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10+
11+
%{toc}
12+
13+
* {Presentation}
14+
~~~~~~~~~~~~~~~~~~~
15+
16+
As the result of the execution of graphql-maven-plugin:graphql two type of source code is generated
17+
18+
* The Query, Mutation and POJOs classes
19+
20+
* All the necessary runtime classes that do not depend on the schema and support the client execution
21+
22+
[]
23+
24+
The runtime classes are copied as source code so, your project, when it runs, doesn't depend on any external dependency from graphql-java-generator.
25+
But if for any reason you don't what the the runtime classes in your generated source code (and you just want to add them as a dependency) it is possible to customize
26+
the plugin execution so they are not generated
27+
28+
29+
30+
* {How to use the configure source code generation to no include runtime classes?}
31+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
32+
33+
To avoid the generation of runtime classes you can use the parameter <<copyGraphQLJavaSources>> (-Dcom.graphql_java_generator.mavenplugin.copyGraphQLJavaSources)
34+
If copyGraphQLJavaSources is "false", then the runtime classes won't be generated. By default, the parameter value is "true"
35+
36+
Here there's an exmaple of plugin configuration to not generate runtime classes
37+
38+
+--------------------------------------------------------------------------------------------
39+
<project ...>
40+
...
41+
42+
<build>
43+
<plugins>
44+
...
45+
<plugin>
46+
<groupId>com.graphql-java-generator</groupId>
47+
<artifactId>graphql-maven-plugin</artifactId>
48+
<version>${lastReleasedVersion}</version>
49+
<executions>
50+
<execution>
51+
<goals>
52+
<goal>graphql</goal>
53+
</goals>
54+
</execution>
55+
</executions>
56+
<configuration>
57+
<mode>client</mode>
58+
<packageName>my.target.package</packageName>
59+
<copyGraphQLJavaSources>false</copyGraphQLJavaSources>
60+
</configuration>
61+
</plugin>
62+
</plugins>
63+
</build>
64+
...
65+
</project>
66+
+--------------------------------------------------------------------------------------------
67+
68+
Remember that it you decide not to generate runtime classes, <<com.graphql-java-generator:graphql-java-runtime:${lastReleasedVersion}>> shall be somehow included in your classpath
69+
You may use <<com.graphql-java-generator:graphql-java-runtime:${lastReleasedVersion}>> artifact as a dependency in your project to include graphql-java-runtime in your classpath
70+
71+
+--------------------------------------------------------------------------------------------
72+
<project ...>
73+
...
74+
<dependencies>
75+
...
76+
<dependency>
77+
<groupId>com.graphql-java-generator</groupId>
78+
<artifactId>graphql-java-runtime</artifactId>
79+
<version>${lastReleasedVersion}</version>
80+
<exclusions>
81+
<exclusion>
82+
<groupId>com.graphql-java-generator</groupId>
83+
<artifactId>graphql-java-server-dependencies</artifactId>
84+
</exclusion>
85+
</exclusions>
86+
</dependency>
87+
...
88+
</dependencies>
89+
...
90+
</project>
91+
+--------------------------------------------------------------------------------------------
92+

src/site/site.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<menu name="Client mode">
2525
<item name="Plugin usage" href="client.html" />
2626
<item name="Introspection" href="introspection.html" />
27+
<item name="Runtime Classes" href="runtimeclasses.html" />
2728
</menu>
2829

2930
<menu name="Server mode">

0 commit comments

Comments
 (0)