initial commit

This commit is contained in:
Zellweger Christof Ralf
2015-05-27 16:59:20 +02:00
parent d4e8617ae2
commit 0fe81045d5
21 changed files with 138 additions and 18 deletions

View File

@ -2,15 +2,9 @@
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="org.springsource.ide.eclipse.gradle.classpathcontainer"/>
<classpathentry kind="output" path="bin"/>
</classpath>

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/build/
/bin/

View File

@ -0,0 +1 @@
#Tue May 26 17:53:04 CEST 2015

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
#Wed May 27 09:37:38 CEST 2015

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ch.psi.daq.rest</name>
<name>rest</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
@ -9,14 +10,9 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.springsource.ide.eclipse.gradle.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,5 @@
#org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences
#Tue May 26 17:48:59 CEST 2015
build.family.org.gradle.tooling.model.eclipse.HierarchicalEclipseProject=;
org.springsource.ide.eclipse.gradle.linkedresources=
org.springsource.ide.eclipse.gradle.rootprojectloc=

View File

@ -0,0 +1,13 @@
#
#Wed May 27 10:41:51 CEST 2015
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error

49
build.gradle Normal file
View File

@ -0,0 +1,49 @@
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = 1.8
version = '1.0.0'
group = 'ch.psi.daq'
repositories {
mavenLocal()
mavenCentral()
maven { url "http://slsyoke4.psi.ch:8081/artifactory/libs-releases" }
maven { url "http://slsyoke4.psi.ch:8081/artifactory/libs-snapshots" }
}
dependencies {
compile 'ch.psi.daq:cassandra:1.0.0'
compile 'org.springframework.boot:spring-boot-starter-web:1.2.3.RELEASE'
compile 'org.apache.commons:commons-lang3:3.4'
testCompile group: 'junit', name: 'junit', version: '4.+'
}
apply plugin: 'maven'
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "http://slsyoke4.psi.ch:8081/artifactory/libs-snapshots-local"){
authentication(userName: "upload", password: "{DESede}eWKHxAtQ2Dc=")
}
pom.groupId = 'ch.psi.daq'
pom.artifactId = 'rest'
}
}
}

1
settings.gradle Normal file
View File

@ -0,0 +1 @@
rootProject.name = 'rest'

View File

@ -0,0 +1,13 @@
package ch.psi.daq.rest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import ch.psi.daq.cassandra.writer.CassandraWriter;
@RestController
public class DaqController {
@Autowired
private CassandraWriter writer;
}

View File

@ -0,0 +1,45 @@
package ch.psi.daq.rest;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
/**
* Entry point to our rest-frontend of the Swissfel application which most importantly wires all the @RestController annotated classes.
* <p>
*
* This acts as a @Configuration class for Spring. As such it has @ComponentScan
* annotation that enables scanning for another Spring components in current
* package and its subpackages.
* <p>
* Another annotation is @EnableAutoConfiguration which tells Spring Boot to run
* autoconfiguration.
* <p>
* It also extends SpringBootServletInitializer which will configure Spring
* servlet for us, and overrides the configure() method to point to itself, so
* Spring can find the main configuration.
* <p>
* Finally, the main() method consists of single static call to
* SpringApplication.run().
* <p>
* Methods annotated with {@link @Bean} are Java beans that are
* container-managed, i.e. managed by Spring. Whenever there are @Autowire, @Inject
* or similar annotations found in the code (which is being scanned through the @ComponentScan
* annotation), the container then knows how to create those beans and inject
* them accordingly.
*/
@SpringBootApplication
@ComponentScan(basePackages = { "ch.psi.daq" })
public class DaqRestApplication extends SpringBootServletInitializer {
public static void main(final String[] args) {
SpringApplication.run(DaqRestApplication.class, args);
}
@Override
protected final SpringApplicationBuilder configure(final SpringApplicationBuilder application) {
return application.sources(DaqRestApplication.class);
}
}