Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Spring Boot's dependency BOM, fix spring-boot:run at parent project level #276

Merged
merged 4 commits into from
Oct 30, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,55 @@ entity_dataset {
'
```

#### Tips for quickly running Postgres, Redis and Kafka locally with Docker
## Development

Notes:

- Use of Lombok is being phased out, prefer to use [Google Auto] in new code.

[Google Auto]: https://github.com/google/auto

### Running Unit Tests

$ mvn test

### Running Integration Tests

_Note: integration suite isn't yet separated from unit._

$ mvn verify

### Running Components Locally

The `core` and `serving` modules are Spring Boot applications. These may be run as usual for [the Spring Boot Maven plugin][boot-maven]:

$ mvn --also-make --projects core sprint-boot:run

# Or for short:
$ mvn -am -pl core spring-boot:run

Note the use of `--also-make` since some components depend on library modules from within the project.

[boot-maven]: https://docs.spring.io/spring-boot/docs/current/maven-plugin/index.html

#### Running From IntelliJ

IntelliJ IDEA Ultimate has built-in support for Spring Boot projects, so everything may work out of the box. The Community Edition needs help with two matters:

1. The IDE is [not clever enough][idea-also-make] to apply `--also-make` for Maven when it should.
1. The Spring Boot Maven plugin automatically puts dependencies with `provided` scope on the runtime classpath when using `spring-boot:run`, such as its embedded Tomcat server. The "Play" buttons in the gutter or right-click menu of a `main()` method [do not do this][idea-boot-main].

Fortunately there is one simple way to address both:

1. Open `View > Tool Windows > Maven`
1. Drill down to e.g. `Feast Core > Plugins > spring-boot:run`, right-click and `Create 'feast-core [spring-boot'…`
1. In the dialog that pops up, check the `Resolve Workspace artifacts` box
1. Click `OK`. You should now be able to select this run configuration for the Play button in the main toolbar, keyboard shortcuts, etc.

[idea-also-make]: https://stackoverflow.com/questions/15073877/using-mavens-also-make-option-in-intellij
[idea-boot-main]: https://stackoverflow.com/questions/30237768/run-spring-boots-main-using-ide

#### Tips for Running Postgres, Redis and Kafka with Docker

This guide assumes you are running Docker service on a bridge network (which
is usually the case if you're running Linux). Otherwise, you may need to
Expand Down
26 changes: 20 additions & 6 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down Expand Up @@ -87,6 +94,14 @@
<version>${project.version}</version>
</dependency>

<!-- Hot reloading for Spring Boot. spring-boot-maven-plugin removes
this automatically when packaging. -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
Expand All @@ -111,7 +126,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${springBootVersion}</version>
</dependency>
<!--compile "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}"-->
<dependency>
Expand All @@ -125,7 +139,6 @@
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>


<!--compile "io.grpc:grpc-services:${grpcVersion}"-->
<dependency>
<groupId>io.grpc</groupId>
Expand Down Expand Up @@ -175,8 +188,8 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
<scope>runtime</scope>
<scope>provided</scope>
<optional>true</optional>
</dependency>

<dependency>
Expand All @@ -190,10 +203,9 @@
<artifactId>lombok</artifactId>
</dependency>

<!--testCompile 'org.hamcrest:hamcrest-all:1.3'-->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<artifactId>hamcrest-library</artifactId>
</dependency>

<!--testCompile 'com.jayway.jsonpath:json-path-assert:2.2.0'-->
Expand All @@ -213,10 +225,12 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test-autoconfigure</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import feast.types.FieldProto.Field;
import feast.types.ValueProto.BoolList;
import feast.types.ValueProto.Value;
import feast.types.ValueProto.ValueType;
import java.io.IOException;
import org.junit.Before;
import org.junit.Test;
Expand Down
1 change: 0 additions & 1 deletion ingestion/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.12</artifactId>
<version>2.3.0</version>
<scope>test</scope>
</dependency>

Expand Down
Loading