├── .classpath ├── .gitignore ├── .project ├── .settings ├── gradle.prefs ├── gradle │ ├── org.springsource.ide.eclipse.gradle.core.import.prefs │ ├── org.springsource.ide.eclipse.gradle.core.prefs │ └── org.springsource.ide.eclipse.gradle.refresh.prefs ├── org.eclipse.jdt.core.prefs ├── org.eclipse.wst.common.component └── org.eclipse.wst.common.project.facet.core.xml ├── JacketRepository ├── .classpath ├── .project ├── .settings │ ├── gradle │ │ ├── org.springsource.ide.eclipse.gradle.core.prefs │ │ └── org.springsource.ide.eclipse.gradle.refresh.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.wst.common.component │ └── org.eclipse.wst.common.project.facet.core.xml ├── build.gradle └── src │ ├── integration-test │ ├── java │ │ └── com │ │ │ └── pluralsight │ │ │ └── repository │ │ │ ├── AbstractTest.java │ │ │ ├── ApplicationConfiguration.java │ │ │ └── EntryRepositoryTest.java │ └── resources │ │ └── data.sql │ └── main │ └── java │ └── com │ └── pluralsight │ ├── jacket │ └── models │ │ ├── BaseModel.java │ │ └── Entry.java │ └── repository │ └── EntryRepository.java ├── JacketService ├── .classpath ├── .gradle │ └── 2.4 │ │ └── taskArtifacts │ │ ├── cache.properties │ │ ├── cache.properties.lock │ │ ├── fileHashes.bin │ │ ├── fileSnapshots.bin │ │ ├── outputFileStates.bin │ │ └── taskArtifacts.bin ├── .project ├── .settings │ ├── gradle │ │ └── org.springsource.ide.eclipse.gradle.core.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.wst.common.component │ └── org.eclipse.wst.common.project.facet.core.xml ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src │ ├── main │ └── java │ │ └── com │ │ └── pluralsight │ │ └── jacket │ │ ├── models │ │ └── JacketEntry.java │ │ └── services │ │ ├── AuthenticationService.java │ │ ├── JacketEntryService.java │ │ └── JacketEntryServiceOnRepository.java │ └── test │ └── java │ └── com │ └── pluralsight │ └── jacket │ └── services │ └── test │ └── JacketEntryServiceOnRepositoryTest.java ├── JacketWeb ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── gradle │ │ └── org.springsource.ide.eclipse.gradle.core.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.wst.common.component │ └── org.eclipse.wst.common.project.facet.core.xml ├── build.gradle ├── configfiles │ ├── application.properties │ └── context.xml ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── spring.log └── src │ └── main │ ├── java │ └── com │ │ └── pluralsight │ │ ├── app │ │ └── JacketApplication.java │ │ ├── config │ │ ├── WebAppInitializer.java │ │ └── WebConfig.java │ │ └── controller │ │ └── Link.java │ ├── resources │ └── logback.xml │ └── webapp │ ├── WEB-INF │ ├── views │ │ └── link │ │ │ └── index.html │ └── web.xml │ └── resources │ └── css │ └── site.css ├── README.md ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── migrations └── common │ ├── 1__Create_users_table.sql │ └── 2__Create_entries_table.sql └── settings.gradle /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio 2 | # added eclipse 3 | 4 | *.iml 5 | 6 | ## Directory-based project format: 7 | .idea/ 8 | # if you remove the above rule, at least ignore the following: 9 | 10 | # User-specific stuff: 11 | # .idea/workspace.xml 12 | # .idea/tasks.xml 13 | # .idea/dictionaries 14 | 15 | # Sensitive or high-churn files: 16 | # .idea/dataSources.ids 17 | # .idea/dataSources.xml 18 | # .idea/sqlDataSources.xml 19 | # .idea/dynamic.xml 20 | # .idea/uiDesigner.xml 21 | 22 | # Gradle: 23 | # .idea/gradle.xml 24 | # .idea/libraries 25 | 26 | # Mongo Explorer plugin: 27 | # .idea/mongoSettings.xml 28 | 29 | ## File-based project format: 30 | *.ipr 31 | *.iws 32 | 33 | ## Plugin-specific files: 34 | 35 | # IntelliJ 36 | /out/ 37 | 38 | # mpeltonen/sbt-idea plugin 39 | .idea_modules/ 40 | 41 | # JIRA plugin 42 | atlassian-ide-plugin.xml 43 | 44 | # Crashlytics plugin (for Android Studio and IntelliJ) 45 | com_crashlytics_export_strings.xml 46 | crashlytics.properties 47 | crashlytics-build.properties 48 | 49 | **/.gradle/ 50 | **/build/ 51 | 52 | # Ignore Gradle GUI config 53 | gradle-app.setting 54 | 55 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 56 | !gradle-wrapper.jar 57 | 58 | *.pydevproject 59 | .metadata 60 | .gradle 61 | **/bin/ 62 | **/tmp/ 63 | *.tmp 64 | *.bak 65 | *.swp 66 | *~.nib 67 | local.properties 68 | .settings/ 69 | .loadpath 70 | 71 | # Eclipse Core 72 | .project 73 | 74 | # External tool builders 75 | .externalToolBuilders/ 76 | 77 | # Locally stored "Eclipse launch configurations" 78 | *.launch 79 | 80 | # CDT-specific 81 | .cproject 82 | 83 | # JDT-specific (Eclipse Java Development Tools) 84 | .classpath 85 | 86 | # Java annotation processor (APT) 87 | .factorypath 88 | 89 | # PDT-specific 90 | .buildpath 91 | 92 | # sbteclipse plugin 93 | .target 94 | 95 | # TeXlipse plugin 96 | .texlipse 97 | 98 | JacketWeb/src/main/resources/application.properties 99 | JacketWeb/src/main/webapp/META-INF/context.xml 100 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Jacket 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.validation.validationbuilder 20 | 21 | 22 | 23 | 24 | 25 | org.springsource.ide.eclipse.gradle.core.nature 26 | org.eclipse.jdt.core.javanature 27 | org.eclipse.wst.common.project.facet.core.nature 28 | org.eclipse.wst.common.modulecore.ModuleCoreNature 29 | org.eclipse.jem.workbench.JavaEMFNature 30 | 31 | 32 | -------------------------------------------------------------------------------- /.settings/gradle.prefs: -------------------------------------------------------------------------------- 1 | { 2 | "1.0": { 3 | "project_path": ":", 4 | "project_dir": "V:\\PS\\ProposedCourses\\Gradle\\prep\\module1", 5 | "connection_project_dir": "V:\\PS\\ProposedCourses\\Gradle\\prep\\module1", 6 | "connection_gradle_user_home": null, 7 | "connection_gradle_distribution": "GRADLE_DISTRIBUTION(LOCAL_INSTALLATION(C:\\home\\kevinj\\gradle))", 8 | "connection_java_home": null, 9 | "connection_jvm_arguments": "", 10 | "connection_arguments": "" 11 | } 12 | } -------------------------------------------------------------------------------- /.settings/gradle/org.springsource.ide.eclipse.gradle.core.import.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.preferences.GradleImportPreferences 2 | #Mon Nov 02 12:07:46 GMT 2015 3 | addResourceFilters=true 4 | afterTasks=afterEclipseImport; 5 | beforeTasks=cleanEclipse;eclipse; 6 | enableAfterTasks=true 7 | enableBeforeTasks=true 8 | enableDependendencyManagement=true 9 | projects=;JacketRepository;JacketService;JacketWeb; 10 | -------------------------------------------------------------------------------- /.settings/gradle/org.springsource.ide.eclipse.gradle.core.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences 2 | #Sun Oct 25 18:37:01 GMT 2015 3 | build.family.org.gradle.tooling.model.eclipse.HierarchicalEclipseProject=;JacketRepository;JacketService;JacketWeb; 4 | org.springsource.ide.eclipse.gradle.linkedresources= 5 | org.springsource.ide.eclipse.gradle.rootprojectloc= 6 | -------------------------------------------------------------------------------- /.settings/gradle/org.springsource.ide.eclipse.gradle.refresh.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.actions.GradleRefreshPreferences 2 | #Thu Jul 23 20:06:14 BST 2015 3 | addResourceFilters=true 4 | afterTasks=afterEclipseImport; 5 | beforeTasks=cleanEclipse;eclipse; 6 | enableAfterTasks=true 7 | enableBeforeTasks=true 8 | useHierarchicalNames=false 9 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | # 2 | #Mon Nov 02 12:55:00 GMT 2015 3 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 7 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 8 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 9 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 10 | eclipse.preferences.version=1 11 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 12 | org.eclipse.jdt.core.compiler.source=1.8 13 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 14 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /JacketRepository/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /JacketRepository/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | JacketRepository 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.validation.validationbuilder 20 | 21 | 22 | 23 | 24 | 25 | org.springsource.ide.eclipse.gradle.core.nature 26 | org.eclipse.jdt.core.javanature 27 | org.eclipse.wst.common.project.facet.core.nature 28 | org.eclipse.wst.common.modulecore.ModuleCoreNature 29 | org.eclipse.jem.workbench.JavaEMFNature 30 | 31 | 32 | -------------------------------------------------------------------------------- /JacketRepository/.settings/gradle/org.springsource.ide.eclipse.gradle.core.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences 2 | #Sun Oct 25 18:37:01 GMT 2015 3 | build.family.org.gradle.tooling.model.eclipse.HierarchicalEclipseProject=; 4 | org.springsource.ide.eclipse.gradle.linkedresources= 5 | org.springsource.ide.eclipse.gradle.rootprojectloc=.. 6 | -------------------------------------------------------------------------------- /JacketRepository/.settings/gradle/org.springsource.ide.eclipse.gradle.refresh.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.actions.GradleRefreshPreferences 2 | #Sun Oct 25 18:36:13 GMT 2015 3 | addResourceFilters=true 4 | afterTasks=afterEclipseImport; 5 | beforeTasks=cleanEclipse;eclipse; 6 | enableAfterTasks=true 7 | enableBeforeTasks=true 8 | useHierarchicalNames=false 9 | -------------------------------------------------------------------------------- /JacketRepository/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | # 2 | #Mon Nov 02 12:55:09 GMT 2015 3 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 7 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 8 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 9 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 10 | eclipse.preferences.version=1 11 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 12 | org.eclipse.jdt.core.compiler.source=1.8 13 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 14 | -------------------------------------------------------------------------------- /JacketRepository/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | uses 7 | 8 | 9 | uses 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /JacketRepository/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /JacketRepository/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | } 6 | 7 | dependencies { 8 | compile "org.springframework.boot:spring-boot-starter-data-jpa" 9 | compile "org.springframework.boot:spring-boot-starter-test" 10 | compile 'org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final' 11 | 12 | compile 'mysql:mysql-connector-java:5.1.35' 13 | 14 | compile 'javax.inject:javax.inject:1' 15 | compile 'commons-logging:commons-logging:1.2' 16 | } 17 | 18 | 19 | task migrateProduction { 20 | group = "deploy" 21 | description = "Run migration scripts for production" 22 | doFirst { 23 | flyway { 24 | url = 'jdbc:mysql://localhost:3306' 25 | user = 'kevin' 26 | password = 'p4ssw0rd' 27 | schemas = ['jacket'] 28 | locations = ["filesystem:${projectDir}/../migrations/common", "filesystem:${projectDir}/../migrations/mysql"] 29 | sqlMigrationPrefix = "" 30 | baselineOnMigrate = true 31 | outOfOrder = true 32 | } 33 | } 34 | } 35 | 36 | 37 | 38 | migrateProduction.finalizedBy flywayMigrate 39 | migrateTest.finalizedBy flywayMigrate 40 | 41 | -------------------------------------------------------------------------------- /JacketRepository/src/integration-test/java/com/pluralsight/repository/AbstractTest.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.repository; 2 | 3 | import javax.transaction.Transactional; 4 | 5 | import org.junit.runner.RunWith; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.jdbc.Sql; 8 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 9 | 10 | @Transactional 11 | @RunWith(SpringJUnit4ClassRunner.class) 12 | @SpringApplicationConfiguration(classes = ApplicationConfiguration.class) 13 | @Sql({"/data.sql"}) 14 | public abstract class AbstractTest { 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /JacketRepository/src/integration-test/java/com/pluralsight/repository/ApplicationConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.repository; 2 | 3 | import java.util.Properties; 4 | 5 | import javax.inject.Inject; 6 | import javax.naming.NamingException; 7 | import javax.persistence.EntityManagerFactory; 8 | import javax.sql.DataSource; 9 | 10 | import org.apache.commons.logging.Log; 11 | import org.apache.commons.logging.LogFactory; 12 | import org.apache.log4j.spi.LoggerFactory; 13 | import org.springframework.beans.factory.annotation.Value; 14 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 15 | import org.springframework.context.annotation.Bean; 16 | import org.springframework.context.annotation.ComponentScan; 17 | import org.springframework.context.annotation.Configuration; 18 | import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; 19 | import org.springframework.data.jpa.repository.config.EnableJpaRepositories; 20 | import org.springframework.jdbc.datasource.DriverManagerDataSource; 21 | import org.springframework.orm.jpa.JpaTransactionManager; 22 | import org.springframework.orm.jpa.JpaVendorAdapter; 23 | import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; 24 | import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; 25 | import org.springframework.transaction.PlatformTransactionManager; 26 | import org.springframework.transaction.annotation.EnableTransactionManagement; 27 | 28 | @Configuration 29 | @EnableAutoConfiguration 30 | @ComponentScan(basePackages = "com.pluralsight") 31 | @EnableJpaRepositories("com.pluralsight.repository") 32 | @EnableTransactionManagement 33 | public class ApplicationConfiguration { 34 | @Bean 35 | public PersistenceExceptionTranslationPostProcessor exceptionTranslation() { 36 | return new PersistenceExceptionTranslationPostProcessor(); 37 | } 38 | 39 | @Bean 40 | public PlatformTransactionManager transactionManager(EntityManagerFactory emf) { 41 | JpaTransactionManager transactionManager = new JpaTransactionManager(); 42 | transactionManager.setEntityManagerFactory(emf); 43 | 44 | return transactionManager; 45 | } 46 | 47 | @Bean 48 | @Inject 49 | public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) 50 | throws IllegalArgumentException, NamingException { 51 | LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); 52 | em.setPersistenceUnitName("jacket"); 53 | em.setDataSource(dataSource); 54 | em.setPackagesToScan(new String[] { "com.pluralsight.jacket.models" }); 55 | 56 | JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); 57 | em.setJpaVendorAdapter(vendorAdapter); 58 | em.setJpaProperties(additionalProperties()); 59 | 60 | return em; 61 | } 62 | 63 | Properties additionalProperties() { 64 | Properties properties = new Properties(); 65 | properties.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect"); 66 | return properties; 67 | } 68 | 69 | @Value("#{environment.jacket_password}") 70 | private String password; 71 | 72 | @Bean 73 | public DataSource dataSourceDev() { 74 | DriverManagerDataSource dataSource = new DriverManagerDataSource(); 75 | dataSource.setDriverClassName("com.mysql.jdbc.Driver"); 76 | dataSource.setUrl("jdbc:mysql://localhost:3306/jackettest"); 77 | dataSource.setUsername("kevin"); 78 | dataSource.setPassword(password); 79 | return dataSource; 80 | } 81 | 82 | 83 | static final Log log = LogFactory.getLog(LoggerFactory.class); 84 | 85 | @Bean 86 | public Log createLogger() { 87 | return LogFactory.getLog("com.pluralsight"); 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /JacketRepository/src/integration-test/java/com/pluralsight/repository/EntryRepositoryTest.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.repository; 2 | 3 | 4 | import static org.hamcrest.Matchers.is; 5 | import static org.hamcrest.Matchers.notNullValue; 6 | import static org.junit.Assert.assertThat; 7 | 8 | import org.junit.Test; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | 11 | import com.pluralsight.jacket.models.Entry; 12 | 13 | public class EntryRepositoryTest extends AbstractTest { 14 | 15 | @Autowired EntryRepository repository; 16 | 17 | /** 18 | * @since Step 2.1 19 | */ 20 | @Test 21 | public void findEntryById() { 22 | 23 | Entry entry = repository.findOne(1L); 24 | 25 | assertThat(entry, is(notNullValue())); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /JacketRepository/src/integration-test/resources/data.sql: -------------------------------------------------------------------------------- 1 | insert into Entries (url) values ('http://news.bbc.co.uk'); 2 | -------------------------------------------------------------------------------- /JacketRepository/src/main/java/com/pluralsight/jacket/models/BaseModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.pluralsight.jacket.models; 17 | 18 | import javax.persistence.GeneratedValue; 19 | import javax.persistence.GenerationType; 20 | import javax.persistence.Id; 21 | import javax.persistence.MappedSuperclass; 22 | 23 | @MappedSuperclass 24 | public class BaseModel { 25 | 26 | @Id 27 | @GeneratedValue(strategy = GenerationType.AUTO) 28 | private Long id; 29 | 30 | public Long getId() { 31 | return id; 32 | } 33 | 34 | /* 35 | * (non-Javadoc) 36 | * @see java.lang.Object#equals(java.lang.Object) 37 | */ 38 | @Override 39 | public boolean equals(Object obj) { 40 | 41 | if (this == obj) { 42 | return true; 43 | } 44 | 45 | if (this.id == null || obj == null || !(this.getClass().equals(obj.getClass()))) { 46 | return false; 47 | } 48 | 49 | BaseModel that = (BaseModel) obj; 50 | 51 | return this.id.equals(that.getId()); 52 | } 53 | 54 | /* 55 | * (non-Javadoc) 56 | * @see java.lang.Object#hashCode() 57 | */ 58 | @Override 59 | public int hashCode() { 60 | return id == null ? 0 : id.hashCode(); 61 | } 62 | } -------------------------------------------------------------------------------- /JacketRepository/src/main/java/com/pluralsight/jacket/models/Entry.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.jacket.models; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Id; 5 | import javax.persistence.Table; 6 | 7 | @Entity 8 | @Table(name = "entries") 9 | public class Entry extends BaseModel { 10 | 11 | private String url; 12 | 13 | public String getUrl() { 14 | return url; 15 | } 16 | public void setUrl(String url) { 17 | this.url = url; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /JacketRepository/src/main/java/com/pluralsight/repository/EntryRepository.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.repository; 2 | 3 | import javax.inject.Named; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.pluralsight.jacket.models.Entry; 8 | 9 | @Named 10 | public interface EntryRepository extends CrudRepository { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /JacketService/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /JacketService/.gradle/2.4/taskArtifacts/cache.properties: -------------------------------------------------------------------------------- 1 | #Mon Jun 29 21:17:41 BST 2015 2 | -------------------------------------------------------------------------------- /JacketService/.gradle/2.4/taskArtifacts/cache.properties.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinrjones/SpringWalkingSkeleton/56bb350cd083124a43feee2cfdc9d82bcfc9dbdc/JacketService/.gradle/2.4/taskArtifacts/cache.properties.lock -------------------------------------------------------------------------------- /JacketService/.gradle/2.4/taskArtifacts/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinrjones/SpringWalkingSkeleton/56bb350cd083124a43feee2cfdc9d82bcfc9dbdc/JacketService/.gradle/2.4/taskArtifacts/fileHashes.bin -------------------------------------------------------------------------------- /JacketService/.gradle/2.4/taskArtifacts/fileSnapshots.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinrjones/SpringWalkingSkeleton/56bb350cd083124a43feee2cfdc9d82bcfc9dbdc/JacketService/.gradle/2.4/taskArtifacts/fileSnapshots.bin -------------------------------------------------------------------------------- /JacketService/.gradle/2.4/taskArtifacts/outputFileStates.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinrjones/SpringWalkingSkeleton/56bb350cd083124a43feee2cfdc9d82bcfc9dbdc/JacketService/.gradle/2.4/taskArtifacts/outputFileStates.bin -------------------------------------------------------------------------------- /JacketService/.gradle/2.4/taskArtifacts/taskArtifacts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinrjones/SpringWalkingSkeleton/56bb350cd083124a43feee2cfdc9d82bcfc9dbdc/JacketService/.gradle/2.4/taskArtifacts/taskArtifacts.bin -------------------------------------------------------------------------------- /JacketService/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | JacketService 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.validation.validationbuilder 20 | 21 | 22 | 23 | 24 | 25 | org.springsource.ide.eclipse.gradle.core.nature 26 | org.eclipse.jdt.core.javanature 27 | org.eclipse.wst.common.project.facet.core.nature 28 | org.eclipse.wst.common.modulecore.ModuleCoreNature 29 | org.eclipse.jem.workbench.JavaEMFNature 30 | 31 | 32 | -------------------------------------------------------------------------------- /JacketService/.settings/gradle/org.springsource.ide.eclipse.gradle.core.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences 2 | #Sun Oct 25 18:34:01 GMT 2015 3 | org.springsource.ide.eclipse.gradle.linkedresources= 4 | org.springsource.ide.eclipse.gradle.rootprojectloc=.. 5 | -------------------------------------------------------------------------------- /JacketService/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | # 2 | #Mon Nov 02 12:55:11 GMT 2015 3 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 7 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 8 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 9 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 10 | eclipse.preferences.version=1 11 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 12 | org.eclipse.jdt.core.compiler.source=1.8 13 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 14 | -------------------------------------------------------------------------------- /JacketService/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | uses 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /JacketService/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /JacketService/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '1.3.0.M5' 4 | } 5 | 6 | repositories { 7 | jcenter() 8 | } 9 | 10 | } 11 | 12 | dependencies { 13 | testCompile 'junit:junit:4.12' 14 | testCompile 'org.assertj:assertj-core:3.2.0' 15 | testCompile 'org.hamcrest:hamcrest-library:1.3' 16 | testCompile 'org.mockito:mockito-core:1.10.19' 17 | 18 | compile 'javax.inject:javax.inject:1' 19 | compile 'commons-logging:commons-logging:1.2' 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /JacketService/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinrjones/SpringWalkingSkeleton/56bb350cd083124a43feee2cfdc9d82bcfc9dbdc/JacketService/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /JacketService/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Aug 30 21:01:16 BST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip 7 | -------------------------------------------------------------------------------- /JacketService/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /JacketService/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /JacketService/src/main/java/com/pluralsight/jacket/models/JacketEntry.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.jacket.models; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * Created by kevin on 30/06/2015. 8 | */ 9 | public class JacketEntry { 10 | 11 | String url; 12 | List tags; 13 | boolean isArchived; 14 | boolean isFavourite; 15 | 16 | public JacketEntry(String url, boolean isArchived, boolean isFavourite) { 17 | this.url = url; 18 | tags = new ArrayList(); 19 | this.isArchived = isArchived; 20 | this.isFavourite = isFavourite; 21 | } 22 | 23 | public JacketEntry(String url) { 24 | this.url = url; 25 | tags = new ArrayList(); 26 | this.isArchived = false; 27 | this.isFavourite = false; 28 | } 29 | 30 | public String getUrl() { 31 | return url; 32 | } 33 | 34 | public void ToggleFavoutite() { 35 | isFavourite = !isFavourite; 36 | } 37 | 38 | public void ToggleArchive() { 39 | isArchived = !isArchived; 40 | } 41 | 42 | public void addTag(String tag) { 43 | // todo: tag should not exist in list already 44 | tags.add(tag); 45 | } 46 | 47 | public void removeTag(String tag) { 48 | // todo: tag should exist in list already 49 | tags.remove(tag); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /JacketService/src/main/java/com/pluralsight/jacket/services/AuthenticationService.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.jacket.services; 2 | 3 | /** 4 | * Created by kevin on 30/06/2015. 5 | */ 6 | public class AuthenticationService { 7 | 8 | String url; 9 | boolean isFavoutire; 10 | boolean isArchived; 11 | } 12 | -------------------------------------------------------------------------------- /JacketService/src/main/java/com/pluralsight/jacket/services/JacketEntryService.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.jacket.services; 2 | 3 | import java.util.List; 4 | 5 | import com.pluralsight.jacket.models.JacketEntry; 6 | 7 | /** 8 | * Created by kevin on 03/07/2015. 9 | */ 10 | public interface JacketEntryService { 11 | 12 | List getAllEntries(); 13 | void updateEntry(JacketEntry entry); 14 | } 15 | -------------------------------------------------------------------------------- /JacketService/src/main/java/com/pluralsight/jacket/services/JacketEntryServiceOnRepository.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.jacket.services; 2 | 3 | import java.util.LinkedList; 4 | import java.util.List; 5 | 6 | import javax.inject.Inject; 7 | import javax.inject.Named; 8 | 9 | import org.apache.commons.logging.Log; 10 | import org.springframework.transaction.annotation.Transactional; 11 | 12 | import com.pluralsight.jacket.models.Entry; 13 | import com.pluralsight.jacket.models.JacketEntry; 14 | import com.pluralsight.repository.EntryRepository; 15 | 16 | @Named 17 | @Transactional(readOnly = true) 18 | public class JacketEntryServiceOnRepository implements JacketEntryService { 19 | 20 | EntryRepository repository; 21 | Log log; 22 | 23 | @Inject 24 | public JacketEntryServiceOnRepository(EntryRepository repository, Log log) { 25 | this.repository = repository; 26 | this.log = log; 27 | } 28 | 29 | 30 | @Override 31 | public List getAllEntries() { 32 | Iterable entries = repository.findAll(); 33 | List serviceEntries = new LinkedList(); 34 | if(entries != null) 35 | { 36 | entries.forEach(e -> serviceEntries.add(new JacketEntry(e.getUrl()))); 37 | } 38 | else 39 | { 40 | log.debug("*********** repository return null"); 41 | } 42 | return serviceEntries; 43 | } 44 | 45 | 46 | @Override 47 | @Transactional(readOnly = false) 48 | public void updateEntry(JacketEntry e) { 49 | 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /JacketService/src/test/java/com/pluralsight/jacket/services/test/JacketEntryServiceOnRepositoryTest.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.jacket.services.test; 2 | 3 | import static org.mockito.Mockito.mock; 4 | import static org.mockito.Mockito.when; 5 | import static org.assertj.core.api.Assertions.*; 6 | 7 | import java.util.Arrays; 8 | import java.util.List; 9 | 10 | import org.apache.commons.logging.Log; 11 | import org.junit.Before; 12 | import org.junit.Test; 13 | 14 | import com.pluralsight.jacket.models.Entry; 15 | import com.pluralsight.jacket.models.JacketEntry; 16 | import com.pluralsight.jacket.services.JacketEntryServiceOnRepository; 17 | import com.pluralsight.repository.EntryRepository; 18 | 19 | /** 20 | * Created by Kevin on 03/07/2015. 21 | */ 22 | public class JacketEntryServiceOnRepositoryTest { 23 | JacketEntryServiceOnRepository jacketEntryServiceOnRepository; 24 | EntryRepository repository; 25 | Log log; 26 | 27 | @Before 28 | public void before(){ 29 | repository = mock(EntryRepository.class); 30 | log = mock(Log.class); 31 | } 32 | 33 | @Test 34 | public void shouldReturnAllEntries() { 35 | 36 | when(repository.findAll()).thenReturn(Arrays.asList(new Entry())); 37 | 38 | JacketEntryServiceOnRepository service = new JacketEntryServiceOnRepository(repository, log); 39 | List entries = service.getAllEntries(); 40 | 41 | assertThat(entries.size()).isEqualTo(1); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /JacketWeb/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /JacketWeb/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /JacketWeb/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | JacketWeb 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.validation.validationbuilder 20 | 21 | 22 | 23 | 24 | 25 | org.springsource.ide.eclipse.gradle.core.nature 26 | org.eclipse.jdt.core.javanature 27 | org.eclipse.wst.common.project.facet.core.nature 28 | org.eclipse.wst.common.modulecore.ModuleCoreNature 29 | org.eclipse.jem.workbench.JavaEMFNature 30 | 31 | 32 | -------------------------------------------------------------------------------- /JacketWeb/.settings/gradle/org.springsource.ide.eclipse.gradle.core.prefs: -------------------------------------------------------------------------------- 1 | #org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences 2 | #Sun Oct 25 18:33:39 GMT 2015 3 | org.springsource.ide.eclipse.gradle.linkedresources= 4 | org.springsource.ide.eclipse.gradle.rootprojectloc=.. 5 | -------------------------------------------------------------------------------- /JacketWeb/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | # 2 | #Mon Nov 02 12:55:18 GMT 2015 3 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 7 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 8 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 9 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 10 | eclipse.preferences.version=1 11 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 12 | org.eclipse.jdt.core.compiler.source=1.8 13 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 14 | -------------------------------------------------------------------------------- /JacketWeb/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | uses 10 | 11 | 12 | uses 13 | 14 | 15 | uses 16 | 17 | 18 | uses 19 | 20 | 21 | uses 22 | 23 | 24 | uses 25 | 26 | 27 | uses 28 | 29 | 30 | uses 31 | 32 | 33 | uses 34 | 35 | 36 | uses 37 | 38 | 39 | uses 40 | 41 | 42 | uses 43 | 44 | 45 | uses 46 | 47 | 48 | uses 49 | 50 | 51 | uses 52 | 53 | 54 | uses 55 | 56 | 57 | uses 58 | 59 | 60 | uses 61 | 62 | 63 | uses 64 | 65 | 66 | uses 67 | 68 | 69 | uses 70 | 71 | 72 | uses 73 | 74 | 75 | uses 76 | 77 | 78 | uses 79 | 80 | 81 | uses 82 | 83 | 84 | uses 85 | 86 | 87 | uses 88 | 89 | 90 | uses 91 | 92 | 93 | uses 94 | 95 | 96 | uses 97 | 98 | 99 | uses 100 | 101 | 102 | uses 103 | 104 | 105 | uses 106 | 107 | 108 | uses 109 | 110 | 111 | uses 112 | 113 | 114 | uses 115 | 116 | 117 | uses 118 | 119 | 120 | uses 121 | 122 | 123 | uses 124 | 125 | 126 | uses 127 | 128 | 129 | uses 130 | 131 | 132 | uses 133 | 134 | 135 | uses 136 | 137 | 138 | uses 139 | 140 | 141 | uses 142 | 143 | 144 | uses 145 | 146 | 147 | uses 148 | 149 | 150 | uses 151 | 152 | 153 | uses 154 | 155 | 156 | uses 157 | 158 | 159 | uses 160 | 161 | 162 | uses 163 | 164 | 165 | uses 166 | 167 | 168 | uses 169 | 170 | 171 | uses 172 | 173 | 174 | uses 175 | 176 | 177 | uses 178 | 179 | 180 | uses 181 | 182 | 183 | uses 184 | 185 | 186 | uses 187 | 188 | 189 | uses 190 | 191 | 192 | uses 193 | 194 | 195 | uses 196 | 197 | 198 | uses 199 | 200 | 201 | uses 202 | 203 | 204 | uses 205 | 206 | 207 | uses 208 | 209 | 210 | uses 211 | 212 | 213 | uses 214 | 215 | 216 | uses 217 | 218 | 219 | uses 220 | 221 | 222 | uses 223 | 224 | 225 | uses 226 | 227 | 228 | uses 229 | 230 | 231 | uses 232 | 233 | 234 | uses 235 | 236 | 237 | 238 | -------------------------------------------------------------------------------- /JacketWeb/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JacketWeb/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | dependencies { 6 | classpath 'com.bmuschko:gradle-cargo-plugin:2.2' 7 | } 8 | } 9 | 10 | apply plugin: 'war' 11 | apply plugin: 'com.bmuschko.cargo' 12 | 13 | cargo { 14 | containerId = 'tomcat8x' 15 | port = 8080 16 | 17 | deployable { 18 | file = file('build\\libs\\JacketWeb-0.0.1-SNAPSHOT.war') 19 | context = 'jacketweb' 20 | } 21 | 22 | local { 23 | homeDir = file('C:\\home\\kevinj\\tomcat') 24 | configHomeDir = file('C:\\home\\kevinj\\tomcat') 25 | } 26 | 27 | remote { 28 | hostname = 'localhost' 29 | username = 'tomcat' 30 | password = 'tomcat' 31 | } 32 | } 33 | 34 | war { 35 | baseName = 'JacketWeb' 36 | version = '0.0.1-SNAPSHOT' 37 | } 38 | sourceCompatibility = 1.8 39 | targetCompatibility = 1.8 40 | 41 | repositories { 42 | jcenter() 43 | } 44 | 45 | 46 | configurations { 47 | providedRuntime 48 | } 49 | 50 | 51 | dependencies { 52 | def cargoVersion = '1.4.5' 53 | 54 | // compile("org.springframework.boot:spring-boot-starter-data-rest") 55 | // compile("org.springframework.boot:spring-boot-starter-hateoas") 56 | // compile("org.springframework.boot:spring-boot-starter-jersey") 57 | // compile("org.springframework.boot:spring-boot-starter-websocket") 58 | // compile("org.springframework.boot:spring-boot-starter-ws") 59 | // runtime("mysql:mysql-connector-java") 60 | 61 | 62 | compile "org.springframework.boot:spring-boot-starter-actuator" 63 | compile "org.springframework.boot:spring-boot-starter-data-jpa" 64 | compile "org.springframework.boot:spring-boot-starter-jdbc" 65 | compile "org.springframework.boot:spring-boot-starter-web" 66 | compile "org.springframework.boot:spring-boot-starter-thymeleaf" 67 | compile "org.springframework.boot:spring-boot-devtools" 68 | compile "org.apache.tomcat:tomcat-dbcp:8.0.27" 69 | 70 | providedRuntime "org.springframework.boot:spring-boot-starter-tomcat" 71 | providedRuntime "org.apache.tomcat.embed:tomcat-embed-jasper" 72 | 73 | compile "javax.servlet:jstl" 74 | 75 | compile 'javax.inject:javax.inject:1' 76 | compile 'c3p0:c3p0:0.9.1.2' 77 | 78 | compile "org.springframework:spring-orm:4.1.7.RELEASE" 79 | 80 | testCompile("org.springframework.boot:spring-boot-starter-test") 81 | 82 | cargo "org.codehaus.cargo:cargo-core-uberjar:$cargoVersion", 83 | "org.codehaus.cargo:cargo-ant:$cargoVersion" 84 | 85 | } 86 | 87 | tasks.withType(Copy) { 88 | eachFile { println it.file } 89 | } 90 | 91 | // must set the jacket_password environment variable for the production password 92 | task copyContext (type: Copy) { 93 | from 'configfiles' 94 | into 'src/main/webapp/META-INF' 95 | include 'context.xml' 96 | 97 | expand(password: "$System.env.jacket_password") 98 | } 99 | 100 | task copyProperties (type: Copy) { 101 | from 'configfiles' 102 | into 'src/main/resources' 103 | include 'application.properties' 104 | 105 | expand(password: "$System.env.jacket_password") 106 | } 107 | 108 | task copyConfiguration { 109 | description 'Copy and expand the configuration files used by the project' 110 | dependsOn copyContext, copyProperties 111 | } 112 | 113 | assemble.dependsOn copyConfiguration 114 | 115 | cargoRunLocal.dependsOn assemble 116 | cargoRedeployLocal.dependsOn assemble 117 | cargoRedeployRemote.dependsOn assemble 118 | eclipse { 119 | classpath { 120 | containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER') 121 | containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8' 122 | } 123 | } 124 | 125 | task wrapper(type: Wrapper) { 126 | gradleVersion = '2.8' 127 | } 128 | -------------------------------------------------------------------------------- /JacketWeb/configfiles/application.properties: -------------------------------------------------------------------------------- 1 | #set -Dspring.active.profiles=dev on the command line when running the app 2 | 3 | spring.datasource.driverClassName=com.mysql.jdbc.Driver 4 | spring.datasource.url=jdbc:mysql://localhost:3306 5 | spring.datasource.username=kevin 6 | spring.datasource.password=${password} 7 | spring.datasource.schema=jacket 8 | 9 | # this will be overridden from command line property when running the embedded app 10 | spring.profiles.active=production 11 | 12 | 13 | #logging.level.org.springframework.web: ERROR 14 | logging.level.*: INFO 15 | logging.file: spring.log 16 | -------------------------------------------------------------------------------- /JacketWeb/configfiles/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | -------------------------------------------------------------------------------- /JacketWeb/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinrjones/SpringWalkingSkeleton/56bb350cd083124a43feee2cfdc9d82bcfc9dbdc/JacketWeb/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /JacketWeb/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Nov 02 12:50:18 GMT 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip 7 | -------------------------------------------------------------------------------- /JacketWeb/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >&- 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >&- 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /JacketWeb/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /JacketWeb/src/main/java/com/pluralsight/app/JacketApplication.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.app; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.context.annotation.ComponentScan; 7 | 8 | @SpringBootApplication 9 | @EnableAutoConfiguration 10 | @ComponentScan("com.pluralsight") 11 | public class JacketApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(JacketApplication.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /JacketWeb/src/main/java/com/pluralsight/config/WebAppInitializer.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.config; 2 | 3 | import javax.servlet.ServletContext; 4 | import javax.servlet.ServletException; 5 | import javax.servlet.ServletRegistration; 6 | 7 | import org.springframework.web.WebApplicationInitializer; 8 | import org.springframework.web.context.ContextLoaderListener; 9 | import org.springframework.web.context.WebApplicationContext; 10 | import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; 11 | import org.springframework.web.servlet.DispatcherServlet; 12 | 13 | public class WebAppInitializer implements WebApplicationInitializer { 14 | 15 | @Override 16 | public void onStartup(ServletContext servletContext) throws ServletException { 17 | WebApplicationContext context = getContext(); 18 | servletContext.addListener(new ContextLoaderListener(context)); 19 | 20 | 21 | ServletRegistration.Dynamic dispatcher = servletContext.addServlet("DispatcherServlet", new DispatcherServlet(context) ); 22 | dispatcher.setLoadOnStartup(1); 23 | 24 | dispatcher.addMapping("/"); 25 | } 26 | 27 | private WebApplicationContext getContext() { 28 | AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); 29 | context.register(WebConfig.class); 30 | return context; 31 | } 32 | 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /JacketWeb/src/main/java/com/pluralsight/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.config; 2 | 3 | import java.util.Properties; 4 | 5 | import javax.inject.Inject; 6 | import javax.naming.NamingException; 7 | import javax.persistence.EntityManagerFactory; 8 | import javax.sql.DataSource; 9 | 10 | import org.apache.commons.logging.Log; 11 | import org.apache.commons.logging.LogFactory; 12 | import org.apache.log4j.spi.LoggerFactory; 13 | import org.springframework.beans.factory.annotation.Value; 14 | import org.springframework.context.annotation.Bean; 15 | import org.springframework.context.annotation.ComponentScan; 16 | import org.springframework.context.annotation.Configuration; 17 | import org.springframework.context.annotation.Profile; 18 | import org.springframework.context.annotation.PropertySource; 19 | import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; 20 | import org.springframework.data.jpa.repository.config.EnableJpaRepositories; 21 | import org.springframework.jdbc.datasource.DriverManagerDataSource; 22 | import org.springframework.jndi.JndiObjectFactoryBean; 23 | import org.springframework.orm.jpa.JpaTransactionManager; 24 | import org.springframework.orm.jpa.JpaVendorAdapter; 25 | import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; 26 | import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; 27 | import org.springframework.transaction.PlatformTransactionManager; 28 | import org.springframework.transaction.annotation.EnableTransactionManagement; 29 | import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; 30 | import org.springframework.web.servlet.config.annotation.EnableWebMvc; 31 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 32 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 33 | import org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver; 34 | 35 | @Configuration 36 | @EnableWebMvc 37 | @ComponentScan(basePackages = "com.pluralsight") 38 | @PropertySource("classpath:application.properties") 39 | @EnableJpaRepositories("com.pluralsight.repository") 40 | @EnableTransactionManagement 41 | public class WebConfig extends WebMvcConfigurerAdapter { 42 | 43 | @Override 44 | public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { 45 | configurer.enable(); 46 | } 47 | 48 | @Override 49 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 50 | registry.addResourceHandler("/resources/**").addResourceLocations("/resources/"); 51 | } 52 | 53 | @Bean 54 | public SpringResourceTemplateResolver getSpringResourceTemplateResolver() { 55 | SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver(); 56 | 57 | resolver.setPrefix("/WEB-INF/views/"); 58 | resolver.setSuffix(".html"); 59 | resolver.setTemplateMode("HTML5"); 60 | 61 | return resolver; 62 | } 63 | 64 | @Bean 65 | public PersistenceExceptionTranslationPostProcessor exceptionTranslation() { 66 | return new PersistenceExceptionTranslationPostProcessor(); 67 | } 68 | 69 | @Bean 70 | public PlatformTransactionManager transactionManager(EntityManagerFactory emf) { 71 | JpaTransactionManager transactionManager = new JpaTransactionManager(); 72 | transactionManager.setEntityManagerFactory(emf); 73 | 74 | return transactionManager; 75 | } 76 | 77 | @Bean 78 | @Inject 79 | public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) 80 | throws IllegalArgumentException, NamingException { 81 | LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); 82 | em.setPersistenceUnitName("jacket"); 83 | em.setDataSource(dataSource); 84 | em.setPackagesToScan(new String[] { "com.pluralsight.jacket.models" }); 85 | 86 | JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); 87 | em.setJpaVendorAdapter(vendorAdapter); 88 | em.setJpaProperties(additionalProperties()); 89 | 90 | return em; 91 | } 92 | 93 | Properties additionalProperties() { 94 | Properties properties = new Properties(); 95 | // properties.setProperty("hibernate.hbm2ddl.auto", "create-drop"); 96 | properties.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect"); 97 | return properties; 98 | } 99 | 100 | @Value("#{environment.jacket_password}") 101 | private String password; 102 | 103 | @Bean 104 | @Profile("dev") 105 | public DataSource dataSourceDev() { 106 | DriverManagerDataSource dataSource = new DriverManagerDataSource(); 107 | dataSource.setDriverClassName("com.mysql.jdbc.Driver"); 108 | dataSource.setUrl("jdbc:mysql://localhost:3306/jacket"); 109 | dataSource.setUsername("kevin"); 110 | dataSource.setPassword(password); 111 | return dataSource; 112 | } 113 | 114 | 115 | @Bean(destroyMethod = "") 116 | @Profile("production") 117 | public DataSource dataSource() throws IllegalArgumentException, NamingException { 118 | JndiObjectFactoryBean bean = new JndiObjectFactoryBean(); 119 | bean.setJndiName("java:comp/env/jdbc/JacketDB"); 120 | bean.setProxyInterface(DataSource.class); 121 | bean.setLookupOnStartup(false); 122 | bean.afterPropertiesSet(); 123 | return (DataSource) bean.getObject(); 124 | } 125 | 126 | static final Log log = LogFactory.getLog(LoggerFactory.class); 127 | 128 | @Bean 129 | public Log createLogger() { 130 | return LogFactory.getLog("com.pluralsight"); 131 | } 132 | 133 | } 134 | -------------------------------------------------------------------------------- /JacketWeb/src/main/java/com/pluralsight/controller/Link.java: -------------------------------------------------------------------------------- 1 | package com.pluralsight.controller; 2 | 3 | import javax.inject.Inject; 4 | 5 | import org.apache.commons.logging.Log; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | import com.pluralsight.jacket.services.JacketEntryService; 10 | 11 | @Controller 12 | @RequestMapping(value = { "/", "/link" }) 13 | public class Link { 14 | 15 | private JacketEntryService service; 16 | private Log log; 17 | 18 | @Inject 19 | public Link(JacketEntryService service, Log log) { 20 | this.service = service; 21 | this.log = log; 22 | } 23 | 24 | @RequestMapping(value = "/") 25 | public String index() { 26 | service.getAllEntries(); 27 | return "link/index"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /JacketWeb/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /JacketWeb/src/main/webapp/WEB-INF/views/link/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Hello World 7 | 8 | 9 |

Hello, World

10 | 11 | -------------------------------------------------------------------------------- /JacketWeb/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /JacketWeb/src/main/webapp/resources/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SpringWalkingSkeleton 2 | 3 | This is a base project using an annotation driven Spring MVC 4 application that uses services and repositories (not Spring based). 4 | 5 | The code uses injection heavily 6 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = '1.3.0.M5' 4 | } 5 | repositories { 6 | jcenter() 7 | } 8 | dependencies { 9 | classpath 'org.flywaydb:flyway-gradle-plugin:3.2.1' 10 | classpath 'com.h2database:h2:1.4.187' 11 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 12 | classpath("io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE") 13 | } 14 | } 15 | 16 | plugins { 17 | id 'org.unbroken-dome.test-sets' version '1.2.0' 18 | } 19 | 20 | allprojects { 21 | apply plugin: 'java' 22 | apply plugin: 'eclipse' 23 | apply plugin: 'eclipse-wtp' 24 | apply plugin: 'idea' 25 | apply plugin: 'io.spring.dependency-management' 26 | apply plugin: 'spring-boot' 27 | 28 | version = '0.1-SNAPSHOT' 29 | 30 | repositories { 31 | jcenter() 32 | } 33 | 34 | dependencies { 35 | testCompile 'org.hamcrest:hamcrest-core:1.3' 36 | testCompile 'junit:junit:4.12' 37 | testCompile 'org.hamcrest:hamcrest-library:1.3' 38 | testCompile 'org.mockito:mockito-core:1.9.5' 39 | testCompile 'commons-logging:commons-logging:1.2' 40 | 41 | compile 'commons-logging:commons-logging:1.2' 42 | 43 | } 44 | } 45 | 46 | 47 | project(':JacketService') { 48 | dependencies { 49 | compile project(':JacketRepository') 50 | } 51 | } 52 | 53 | project(':JacketWeb') { 54 | dependencies { 55 | compile project(':JacketService') 56 | } 57 | } 58 | 59 | //["JacketRepository", "JacketService", "JacketWeb"].each { name -> 60 | [ "JacketRepository", "JacketService", "JacketWeb"].each { name -> 61 | project(":$name") { 62 | apply plugin: 'org.unbroken-dome.test-sets' 63 | apply plugin: 'org.flywaydb.flyway' 64 | 65 | testSets { 66 | integrationTest { 67 | dirName = 'integration-test' 68 | } 69 | } 70 | 71 | task migrateTest { 72 | group = "test" 73 | description = "Run migration scripts for test" 74 | doFirst { 75 | flyway { 76 | url = 'jdbc:mysql://localhost:3306' 77 | user = 'kevin' 78 | password = 'p4ssw0rd' 79 | schemas = ['jackettest'] 80 | locations = ["filesystem:${projectDir}/../migrations/common", "filesystem:${projectDir}/../migrations/mysql"] 81 | sqlMigrationPrefix = "" 82 | baselineOnMigrate = true 83 | outOfOrder = true 84 | } 85 | } 86 | } 87 | 88 | 89 | migrateTest.finalizedBy flywayMigrate 90 | migrateTest.finalizedBy flywayClean 91 | 92 | flywayMigrate.dependsOn flywayClean 93 | 94 | check.dependsOn integrationTest 95 | integrationTest.dependsOn migrateTest 96 | 97 | integrationTest.mustRunAfter test 98 | integrationTest.description = "Runs integration tests" 99 | 100 | 101 | tasks.withType(Test) { 102 | reports.html.destination = file("${reporting.baseDir}/${it.name}") 103 | } 104 | } 105 | } 106 | 107 | task wrapper(type: Wrapper) { 108 | gradleVersion = '2.8' 109 | } 110 | 111 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinrjones/SpringWalkingSkeleton/56bb350cd083124a43feee2cfdc9d82bcfc9dbdc/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Nov 02 12:50:18 GMT 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >&- 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >&- 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /migrations/common/1__Create_users_table.sql: -------------------------------------------------------------------------------- 1 | create table USERS ( 2 | ID int, 3 | EMAIL varchar(100) not null, 4 | NAME varchar(100) not null, 5 | PASSWORD varchar(100) not null 6 | ); -------------------------------------------------------------------------------- /migrations/common/2__Create_entries_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE entries ( 2 | ID INT NOT NULL AUTO_INCREMENT, 3 | URL VARCHAR(1024) NOT NULL, 4 | ARCHIVED BIT(1) NULL, 5 | FAVOURITE BIT(1) NULL, 6 | PRIMARY KEY (`id`)) 7 | ; -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include 'JacketService', 'JacketRepository', 'JacketWeb' 2 | 3 | 4 | --------------------------------------------------------------------------------