From e7663d04db01ada3f3b87660b6ec49701fe3a750 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Wed, 30 Jul 2014 13:11:23 +1000 Subject: destroy context on close --- .../src/main/java/org/apache/archiva/cli/ArchivaCli.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'archiva-cli/src') diff --git a/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java b/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java index 102f4bfe8..4bb426a62 100644 --- a/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java +++ b/archiva-cli/src/main/java/org/apache/archiva/cli/ArchivaCli.java @@ -110,7 +110,20 @@ public class ArchivaCli return; } - new ArchivaCli().execute( command ); + ArchivaCli cli = new ArchivaCli(); + try + { + cli.execute( command ); + } + finally + { + cli.destroy(); + } + } + + private void destroy() + { + applicationContext.destroy(); } private void execute( Commands command ) -- cgit v1.2.3