Skip to content
This repository was archived by the owner on Oct 24, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-jdbi</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -92,5 +88,9 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.dropwizard-bundles</groupId>
<artifactId>dropwizard-version-bundle</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
package com.mainstreethub.project;

import com.mainstreethub.project.dao.JDBIModule;
import com.mainstreethub.project.dao.UserDAO;
import com.mainstreethub.project.resources.UsersResource;

import io.dropwizard.Application;
import io.dropwizard.jdbi.DBIFactory;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import java.security.SecureRandom;
import org.skife.jdbi.v2.DBI;
import io.dropwizard.bundles.version.VersionBundle;
import io.dropwizard.bundles.version.VersionSupplier;
import io.dropwizard.bundles.version.suppliers.MavenVersionSupplier;


public class ProjectApplication extends Application<ProjectConfiguration> {
public static void main(String[] args) throws Exception {
new ProjectApplication().run(args);
}


@Override
public void initialize(Bootstrap<ProjectConfiguration> bootstrap) {
initVersion(bootstrap);
}

@Override
public void run(ProjectConfiguration configuration, Environment environment) throws Exception {
ProjectComponent component = DaggerProjectComponent.builder()
.jDBIModule(new JDBIModule(configuration.getDatabaseConfiguration(), environment))
.jDBIModule(new JDBIModule(configuration.getDatabase(), environment))
.projectModule(new ProjectModule())
.build();

environment.jersey().register(component.getUsersResource());
}

private void initVersion(Bootstrap<ProjectConfiguration> bootstrap) {
VersionSupplier supplier = new MavenVersionSupplier("com.mainstreethub.project", "application");
bootstrap.addBundle(new VersionBundle(supplier));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class ProjectConfiguration extends Configuration {
@JsonProperty("database")
private DataSourceFactory database = new DataSourceFactory();

public DataSourceFactory getDatabaseConfiguration() {
public DataSourceFactory getDatabase() {
return database;
}
}
17 changes: 9 additions & 8 deletions application/src/main/resources/banner.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
_ _
(o)--(o)
/.______.\
\________/
./ \.
( . , )
\ \_\\//_/ /
~~ ~~ ~~
.______ .______ ______ __ _______ ______ .___________.
| _ \ | _ \ / __ \ | | | ____| / || |
| |_) | | |_) | | | | | | | | |__ | ,----'`---| |----`
| ___/ | / | | | | .--. | | | __| | | | |
| | | |\ \----| `--' | | `--' | | |____ | `----. | |
| _| | _| `._____|\______/ \______/ |_______| \______| |__|


An ASCII Art Editor: http://patorjk.com/software/taag/#p=display&h=3&f=Star%20Wars&t=PROJECT
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
<dagger.version>2.0</dagger.version>
<dropwizard.version>0.8.1</dropwizard.version>
<guava.version>18.0</guava.version>
<h2.version>1.4.187</h2.version>
<jackson.api.version>2.5.0</jackson.api.version>
<jackson.version>2.5.1</jackson.version>
<junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version>
<dropwizard.version.bundle.version>0.8.1-2</dropwizard.version.bundle.version>
</properties>

<build>
Expand Down Expand Up @@ -102,11 +102,6 @@
<artifactId>dropwizard-testing</artifactId>
<version>${dropwizard.version}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -117,6 +112,11 @@
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard-bundles</groupId>
<artifactId>dropwizard-version-bundle</artifactId>
<version>${dropwizard.version.bundle.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down