Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BudgetMaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robert Goldmann
BudgetMaster
Commits
9bef681a
Commit
9bef681a
authored
2 years ago
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
Fixed #586 - make search for available updates working for tomcat
parent
a39afcc7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/update/BudgetMasterUpdateConfiguration.java
+16
-3
16 additions, 3 deletions
.../budgetmaster/update/BudgetMasterUpdateConfiguration.java
with
16 additions
and
3 deletions
BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/update/BudgetMasterUpdateConfiguration.java
+
16
−
3
View file @
9bef681a
...
...
@@ -21,6 +21,9 @@ import java.nio.file.Paths;
@Component
public
class
BudgetMasterUpdateConfiguration
{
@SuppressWarnings
(
"java:S1075"
)
private
static
final
String
TOMCAT_PATH
=
"/usr/local/tomcat"
;
private
UpdateService
.
Strategy
updateStrategy
;
private
String
executablePath
;
private
RemoteFile
.
FileType
fileType
;
...
...
@@ -36,7 +39,6 @@ public class BudgetMasterUpdateConfiguration
@PostConstruct
private
void
postInit
()
{
final
File
source
=
new
ApplicationHome
().
getSource
();
executablePath
=
null
;
updateStrategy
=
UpdateService
.
Strategy
.
JAR
;
fileType
=
RemoteFile
.
FileType
.
JAR
;
...
...
@@ -44,7 +46,18 @@ public class BudgetMasterUpdateConfiguration
SystemUtils
.
setIsJarHook
(
new
IsJarFileHook
());
SystemUtils
.
setIsExeHook
(
new
IsExeFileHook
());
if
(
source
!=
null
)
final
ApplicationHome
applicationHome
=
new
ApplicationHome
();
final
File
source
=
applicationHome
.
getSource
();
if
(
source
==
null
)
{
final
String
appHomeDirectory
=
applicationHome
.
getDir
().
getAbsolutePath
();
if
(
appHomeDirectory
.
equals
(
TOMCAT_PATH
))
{
isRunningFromSource
=
false
;
executablePath
=
appHomeDirectory
;
}
}
else
{
isRunningFromSource
=
false
;
executablePath
=
source
.
getAbsolutePath
();
...
...
@@ -64,7 +77,7 @@ public class BudgetMasterUpdateConfiguration
VersionizerItem
versionizerItem
=
new
VersionizerItem
(
repository
,
executablePath
);
UpdateService
versionizerUpdateService
=
UpdateService
.
startVersionizer
(
versionizerItem
,
updateStrategy
,
UpdateService
.
InteractionType
.
HEADLESS
,
UpdateService
.
RepositoryType
.
RELEASE
);
if
(
executablePath
!=
null
)
if
(
!
isRunningFromSource
)
{
versionizerUpdateService
.
addArtifact
(
artifact
,
Paths
.
get
(
executablePath
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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