Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Plan
Issues
27
Issue boards
Milestones
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
ARSnova
ARSnova Backend
Commits
e238f842
There was an error fetching the commit references. Please try again later.
Commit
e238f842
authored
6 years ago
by
Daniel Gerhardt
Browse files
Options
Downloads
Patches
Plain Diff
Log version info at startup
parent
8234d886
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/thm/arsnova/config/ExtraConfig.java
+18
-0
18 additions, 0 deletions
src/main/java/de/thm/arsnova/config/ExtraConfig.java
with
18 additions
and
0 deletions
src/main/java/de/thm/arsnova/config/ExtraConfig.java
+
18
−
0
View file @
e238f842
...
...
@@ -23,6 +23,8 @@ import de.thm.arsnova.connector.client.ConnectorClientImpl;
import
de.thm.arsnova.socket.ARSnovaSocket
;
import
de.thm.arsnova.socket.ARSnovaSocketIOServer
;
import
de.thm.arsnova.web.CorsFilter
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.config.PropertiesFactoryBean
;
...
...
@@ -39,7 +41,10 @@ import org.springframework.core.io.FileSystemResource;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
java.util.Arrays
;
import
java.util.Properties
;
/**
* Loads property file and configures non-security related beans and components.
...
...
@@ -48,10 +53,14 @@ import java.util.Arrays;
@Configuration
@EnableCaching
public
class
ExtraConfig
extends
WebMvcConfigurerAdapter
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ExtraConfig
.
class
);
@Autowired
private
Environment
env
;
@Resource
(
name
=
"versionInfoProperties"
)
private
Properties
versionInfoProperties
;
@Value
(
value
=
"${connector.enable}"
)
private
boolean
connectorEnable
;
@Value
(
value
=
"${connector.uri}"
)
private
String
connectorUri
;
@Value
(
value
=
"${connector.username}"
)
private
String
connectorUsername
;
...
...
@@ -65,6 +74,15 @@ public class ExtraConfig extends WebMvcConfigurerAdapter {
private
static
int
testPortOffset
=
0
;
@PostConstruct
public
void
init
()
{
logger
.
info
(
"ARSnova Backend version: {} ({} {}{})"
,
versionInfoProperties
.
getProperty
(
"version.string"
),
versionInfoProperties
.
getProperty
(
"version.build-time"
),
versionInfoProperties
.
getProperty
(
"version.git.commit-id"
),
Boolean
.
parseBoolean
(
versionInfoProperties
.
getProperty
(
"version.git.dirty"
))
?
" [dirty]"
:
""
);
}
@Bean
public
static
PropertySourcesPlaceholderConfigurer
propertySourcesPlaceholderConfigurer
()
{
final
PropertySourcesPlaceholderConfigurer
configurer
=
new
PropertySourcesPlaceholderConfigurer
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment