Skip to content

Commit

Permalink
docs: Update installation guides
Browse files Browse the repository at this point in the history
  • Loading branch information
julgus committed Sep 9, 2020
1 parent 06bb6c8 commit 098ff23
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 43 deletions.
18 changes: 7 additions & 11 deletions docs/modules/get-jpa-streamer/pages/install-gradle.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,28 @@ Since JPAStreamer acts merely as an API extension for any existing JPA provider

NOTE: JPAStreamer requires use of Java 8 or later.

To install, add the following JPAStreamer dependency to the project's build.gradle-file:
To install, add the following code to the project's build.gradle-file:

[source, text]
----
repositories {
mavenCentral()
}
dependencies {
dependencies { #<1>
compile "com.speedment.jpastreamer:jpastreamer-core:version"
annotationProcessor "com.speedment.jpastreamer:fieldgenerator-standard:version"
}
----

== Multiple Source Directories
In some cases, the metamodel generated by JPAstreamer is not automatically detected by the compiler as source code. This can be fixed by pointing to an additional source directory in the Gradle build:
[source, text]
----
sourceSets {
sourceSets { #<2>
main {
java {
srcDir 'src/main/java'
srcDir 'target/generated-sources/annotations'#<1>
srcDir 'target/generated-sources/annotations'#<3>
}
}
}
----
<1> Path to the metamodel generated by JPAstreamer
<1> The required JPAstreamer dependencies
<2> Picks up the generated metamodel as an additional source directory
<3> Path to the generated sources
52 changes: 25 additions & 27 deletions docs/modules/get-jpa-streamer/pages/install-maven.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,39 @@ Since JPAStreamer acts merely as an API extension for any existing JPA provider

NOTE: JPAStreamer requires use of Java 8 or later.

To install, add the following JPAStreamer dependency to the project's pom.xml-file:
To install, add the following code to the project's pom.xml-file:

[source, xml]
----
<dependencies>
<dependency>
<dependency> #<1>
<groupId>com.speedment.jpastreamer</groupId>
<artifactId>jpastreamer-core</artifactId>
<version>${jpa-streamer-version}</version>
</dependency>
</dependencies>
----

== Multiple Source Directories
In some cases, the metamodel generated by JPAstreamer is not automatically detected by the compiler as source code. This can be fixed by explicitly pointing to the generated sources using the Maven Build Helper:
[source, xml]
----
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/annotations</source>#<1>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugins>
<plugin> #<2>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/annotations</source>#<3>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
----
<1> Path to the metamodel generated by JPAstreamer
<1> The JPAstreamer core dependency
<2> Picks up the generated metamodel as an additional source directory
<3> Path to the generated sources
46 changes: 41 additions & 5 deletions docs/modules/quick-start/pages/quick-start.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,69 @@ NOTE: This guide assumes you are starting from an existing project that conveys
The installation is performed by notifying your build tool that the JPAstreamer dependency is required to compile your source code. This is accomplished by using either of the following dependencies for Maven or Gradle.

=== Maven
Install JPAStreamer by adding the following dependency in the project's pom.xml-file:
Install JPAStreamer by adding the following code in the project's pom.xml-file:

[source, xml]
----
<dependencies>
<dependency>
<dependency> #<1>
<groupId>com.speedment.jpastreamer</groupId>
<artifactId>jpastreamer-core</artifactId>
<version>${jpa-streamer-version}</version>
</dependency>
</dependencies>
----
<plugins>
<plugin> #<2>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/annotations</source>#<3>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
----
<1> The JPAstreamer core dependency
<2> Picks up the generated metamodel as an additional source directory
<3> Path to the generated sources

=== Gradle
Install JPAStreamer by adding the following dependency in the project's build.gradle-file:
Install JPAStreamer by adding the following code in the project's build.gradle-file:

[source, text]
----
repositories {
mavenCentral()
}
dependencies {
dependencies { #<1>
compile "com.speedment.jpastreamer:jpastreamer-core:version"
annotationProcessor "com.speedment.jpastreamer:fieldgenerator-standard:version"
}
sourceSets { #<2>
main {
java {
srcDir 'src/main/java'
srcDir 'target/generated-sources/annotations'#<3>
}
}
}
----
<1> The required JPAstreamer dependencies
<2> Picks up the generated metamodel as an additional source directory
<3> Path to the generated sources

== Build your project to generate fields
JPAstreamer relies on an annotation processor to generate the static metamodel classes required for the type-safe Stream parameters. This generation automatically takes place during compile time. Once you have added the JPAstreamer dependency, just go ahead and build your project. The metamodel is generated into the target folder in the same package as the corresponding `Entity`.
Expand Down

0 comments on commit 098ff23

Please sign in to comment.