mirror of
https://github.com/OpenLiberty/liberty-bikes.git
synced 2024-11-27 01:20:01 +08:00
commit
6bad57393c
12
auth-service/.classpath
Normal file
12
auth-service/.classpath
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
|
||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer">
|
||||
<attributes>
|
||||
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="build/classes/java/main"/>
|
||||
</classpath>
|
59
auth-service/.settings/org.eclipse.jdt.ui.prefs
Normal file
59
auth-service/.settings/org.eclipse.jdt.ui.prefs
Normal file
@ -0,0 +1,59 @@
|
||||
eclipse.preferences.version=1
|
||||
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
|
||||
org.eclipse.jdt.ui.ignorelowercasenames=true
|
||||
org.eclipse.jdt.ui.importorder=java;javax;org;com;
|
||||
org.eclipse.jdt.ui.javadoc=true
|
||||
org.eclipse.jdt.ui.ondemandthreshold=99
|
||||
org.eclipse.jdt.ui.staticondemandthreshold=99
|
||||
sp_cleanup.add_default_serial_version_id=true
|
||||
sp_cleanup.add_generated_serial_version_id=false
|
||||
sp_cleanup.add_missing_annotations=true
|
||||
sp_cleanup.add_missing_deprecated_annotations=true
|
||||
sp_cleanup.add_missing_methods=false
|
||||
sp_cleanup.add_missing_nls_tags=false
|
||||
sp_cleanup.add_missing_override_annotations=true
|
||||
sp_cleanup.add_missing_override_annotations_interface_methods=true
|
||||
sp_cleanup.add_serial_version_id=false
|
||||
sp_cleanup.always_use_blocks=true
|
||||
sp_cleanup.always_use_parentheses_in_expressions=false
|
||||
sp_cleanup.always_use_this_for_non_static_field_access=false
|
||||
sp_cleanup.always_use_this_for_non_static_method_access=false
|
||||
sp_cleanup.convert_to_enhanced_for_loop=false
|
||||
sp_cleanup.correct_indentation=false
|
||||
sp_cleanup.format_source_code=true
|
||||
sp_cleanup.format_source_code_changes_only=false
|
||||
sp_cleanup.make_local_variable_final=false
|
||||
sp_cleanup.make_parameters_final=false
|
||||
sp_cleanup.make_private_fields_final=false
|
||||
sp_cleanup.make_type_abstract_if_missing_method=false
|
||||
sp_cleanup.make_variable_declarations_final=true
|
||||
sp_cleanup.never_use_blocks=false
|
||||
sp_cleanup.never_use_parentheses_in_expressions=true
|
||||
sp_cleanup.on_save_use_additional_actions=true
|
||||
sp_cleanup.organize_imports=true
|
||||
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
|
||||
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
|
||||
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
|
||||
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
|
||||
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
|
||||
sp_cleanup.remove_private_constructors=true
|
||||
sp_cleanup.remove_trailing_whitespaces=true
|
||||
sp_cleanup.remove_trailing_whitespaces_all=true
|
||||
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
|
||||
sp_cleanup.remove_unnecessary_casts=true
|
||||
sp_cleanup.remove_unnecessary_nls_tags=true
|
||||
sp_cleanup.remove_unused_imports=true
|
||||
sp_cleanup.remove_unused_local_variables=false
|
||||
sp_cleanup.remove_unused_private_fields=true
|
||||
sp_cleanup.remove_unused_private_members=false
|
||||
sp_cleanup.remove_unused_private_methods=true
|
||||
sp_cleanup.remove_unused_private_types=true
|
||||
sp_cleanup.sort_members=false
|
||||
sp_cleanup.sort_members_all=false
|
||||
sp_cleanup.use_blocks=false
|
||||
sp_cleanup.use_blocks_only_for_return_and_throw=false
|
||||
sp_cleanup.use_parentheses_in_expressions=false
|
||||
sp_cleanup.use_this_for_non_static_field_access=false
|
||||
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
|
||||
sp_cleanup.use_this_for_non_static_method_access=false
|
||||
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
|
23
auth-service/build.gradle
Normal file
23
auth-service/build.gradle
Normal file
@ -0,0 +1,23 @@
|
||||
ext {
|
||||
httpPort = 8082
|
||||
httpsPort = 8482
|
||||
appUrl = "http://localhost:${httpPort}/${war.baseName}"
|
||||
}
|
||||
|
||||
liberty {
|
||||
server {
|
||||
name = 'auth-service'
|
||||
dropins = [war]
|
||||
bootstrapProperties = ['httpPort': httpPort, 'httpsPort': httpsPort]
|
||||
}
|
||||
}
|
||||
|
||||
libertyStart.doLast {
|
||||
println "Application available at: ${appUrl}"
|
||||
}
|
||||
|
||||
task open {
|
||||
doLast {
|
||||
java.awt.Desktop.desktop.browse "${appUrl}/token".toURI()
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package org.libertybikes.player.service;
|
||||
|
||||
import javax.ws.rs.ApplicationPath;
|
||||
import javax.ws.rs.core.Application;
|
||||
|
||||
@ApplicationPath("/")
|
||||
public class AuthApp extends Application {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package org.libertybikes.player.service;
|
||||
|
||||
import javax.enterprise.context.ApplicationScoped;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/")
|
||||
@ApplicationScoped
|
||||
public class AuthService {
|
||||
|
||||
@GET
|
||||
@Path("/token")
|
||||
public String getToken() {
|
||||
// TODO this should be using MP JWT to hand back a token
|
||||
return "Super secret token";
|
||||
}
|
||||
|
||||
}
|
9
auth-service/src/main/liberty/config/server.xml
Normal file
9
auth-service/src/main/liberty/config/server.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<server>
|
||||
<featureManager>
|
||||
<feature>microProfile-1.2</feature>
|
||||
</featureManager>
|
||||
|
||||
<httpEndpoint id="defaultHttpEndpoint" httpPort="${httpPort}" httpsPort="${httpsPort}" />
|
||||
|
||||
<applicationManager autoExpand="true"/>
|
||||
</server>
|
79
build.gradle
79
build.gradle
@ -1,49 +1,50 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.wasdev.wlp.gradle.plugins:liberty-gradle-plugin:2.0.1'
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.wasdev.wlp.gradle.plugins:liberty-gradle-plugin:2.0.1'
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply plugin: 'liberty'
|
||||
apply plugin: 'war'
|
||||
apply plugin: 'liberty'
|
||||
apply plugin: 'war'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
sourceCompatibility = 1.8
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.wasdev.wlp.gradle.plugins:liberty-gradle-plugin:2.0.1'
|
||||
}
|
||||
}
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.wasdev.wlp.gradle.plugins:liberty-gradle-plugin:2.0.1'
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly group: 'org.eclipse.microprofile', name: 'microprofile', version: '1.2'
|
||||
compileOnly group: 'javax', name: 'javaee-api', version: '8.0'
|
||||
}
|
||||
|
||||
liberty {
|
||||
install {
|
||||
// use 1 liberty install for the whole repo
|
||||
baseDir = rootProject.buildDir
|
||||
runtimeUrl = "https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/beta/wlp-beta-2017.12.0.0.zip"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
compileOnly group: 'org.eclipse.microprofile', name: 'microprofile', version: '1.2'
|
||||
compileOnly group: 'javax', name: 'javaee-api', version: '8.0'
|
||||
}
|
||||
|
||||
liberty {
|
||||
install {
|
||||
// use 1 liberty install for the whole repo
|
||||
// TODO: re-enable this one liberty-gradle-plugin bug is fixed
|
||||
// baseDir = rootProject.buildDir
|
||||
runtimeUrl = "https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/beta/wlp-beta-2017.12.0.0.zip"
|
||||
}
|
||||
}
|
||||
|
||||
libertyDebug.dependsOn 'libertyStop'
|
||||
libertyStart.dependsOn 'libertyStop'
|
||||
libertyRun.dependsOn 'libertyStop'
|
||||
|
||||
task debug { dependsOn 'libertyDebug' }
|
||||
task start { dependsOn 'libertyStart' }
|
||||
task stop { dependsOn 'libertyStop' }
|
||||
libertyDebug.dependsOn 'libertyStop'
|
||||
libertyStart.dependsOn 'libertyStop'
|
||||
libertyRun.dependsOn 'libertyStop'
|
||||
|
||||
task debug { dependsOn 'libertyDebug' }
|
||||
task start { dependsOn 'libertyStart' }
|
||||
task stop { dependsOn 'libertyStop' }
|
||||
}
|
||||
|
@ -16,5 +16,6 @@ include 'services:webservice'
|
||||
*/
|
||||
|
||||
rootProject.name = 'liberty-bikes'
|
||||
include 'auth-service'
|
||||
include 'game-service'
|
||||
include 'player-service'
|
||||
|
Loading…
Reference in New Issue
Block a user