Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fe0d19d

Browse files
java-main-sync: add Maven support objectbox-java#256
1 parent 4805a68 commit fe0d19d

File tree

2 files changed

+116
-1
lines changed

2 files changed

+116
-1
lines changed

‎java-main-sync/README.md‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,19 @@ This example shows how to use the [Sync client](https://sync.objectbox.io/sync-c
44

55
* See [`Task`](src/main/java/io/objectbox/example/Task.java) on how to define a simple entity
66
* See [`TasksSyncDB`](src/main/java/io/objectbox/example/TasksSyncDB.java) to perform basic operations on [`Task`](src/main/java/io/objectbox/example/Task.java) with the Sync client
7+
8+
## Setup
79

8-
### Docs
10+
It is recommended to build this project using Gradle.
11+
12+
However, this directory also contains a `pom.xml` to build this project using Maven.
13+
14+
To build and execute the program with Maven, run something like: `mvn compile exec:java`
15+
16+
For details about how to set up a project with the ObjectBox Maven plugin,
17+
see the [java-main-maven example](../java-main-maven).
18+
19+
## Docs
920

1021
* [Sync client](https://sync.objectbox.io/sync-client)
1122
* [Sync server](https://sync.objectbox.io/objectbox-sync-server)

‎java-main-sync/pom.xml‎

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.example</groupId>
8+
<artifactId>objectbox-java-main-sync</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<properties>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
14+
<maven.compiler.source>1.8</maven.compiler.source>
15+
<maven.compiler.target>1.8</maven.compiler.target>
16+
17+
<objectboxVersion>4.1.0</objectboxVersion>
18+
</properties>
19+
20+
<dependencies>
21+
<dependency>
22+
<groupId>io.objectbox</groupId>
23+
<artifactId>objectbox-java</artifactId>
24+
<version>${objectboxVersion}</version>
25+
</dependency>
26+
27+
<!-- Native libraries, you can remove the ones for systems you do not support -->
28+
<dependency>
29+
<groupId>io.objectbox</groupId>
30+
<artifactId>objectbox-sync-linux</artifactId>
31+
<version>${objectboxVersion}</version>
32+
</dependency>
33+
<dependency>
34+
<groupId>io.objectbox</groupId>
35+
<artifactId>objectbox-sync-macos</artifactId>
36+
<version>${objectboxVersion}</version>
37+
</dependency>
38+
<dependency>
39+
<groupId>io.objectbox</groupId>
40+
<artifactId>objectbox-sync-windows</artifactId>
41+
<version>${objectboxVersion}</version>
42+
</dependency>
43+
</dependencies>
44+
45+
<build>
46+
<plugins>
47+
48+
<plugin>
49+
<groupId>org.codehaus.mojo</groupId>
50+
<artifactId>versions-maven-plugin</artifactId>
51+
<version>2.7</version>
52+
</plugin>
53+
54+
<!-- Adds the ObjectBox annotation processor to enable code generation -->
55+
<plugin>
56+
<groupId>org.apache.maven.plugins</groupId>
57+
<artifactId>maven-compiler-plugin</artifactId>
58+
<version>3.8.0</version>
59+
<configuration>
60+
<annotationProcessorPaths>
61+
<path>
62+
<groupId>io.objectbox</groupId>
63+
<artifactId>objectbox-processor</artifactId>
64+
<version>${objectboxVersion}</version>
65+
</path>
66+
</annotationProcessorPaths>
67+
<annotationProcessors>
68+
<annotationProcessor>io.objectbox.processor.ObjectBoxProcessorShim</annotationProcessor>
69+
</annotationProcessors>
70+
<compilerArgs>
71+
<arg>-Aobjectbox.modelPath=${project.basedir}/objectbox-models/default.json</arg>
72+
</compilerArgs>
73+
</configuration>
74+
</plugin>
75+
76+
<!-- Runs the ObjectBox byte-code transformer after Maven finishes compiling -->
77+
<plugin>
78+
<groupId>io.objectbox</groupId>
79+
<artifactId>objectbox-maven-plugin</artifactId>
80+
<version>1.3.0</version>
81+
<executions>
82+
<execution>
83+
<goals>
84+
<goal>transform</goal>
85+
</goals>
86+
</execution>
87+
</executions>
88+
<configuration>
89+
<debug>true</debug>
90+
</configuration>
91+
</plugin>
92+
93+
<plugin>
94+
<groupId>org.codehaus.mojo</groupId>
95+
<artifactId>exec-maven-plugin</artifactId>
96+
<version>3.5.0</version>
97+
<configuration>
98+
<mainClass>com.example.objectbox.java.maven.Main</mainClass>
99+
</configuration>
100+
</plugin>
101+
</plugins>
102+
</build>
103+
104+
</project>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /