Skip to content

Commit 37970fe

Browse files
committed
JBIDE-17700: Just in case.
1 parent 74deda7 commit 37970fe

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

maven/impl-projects/src/main/java/org/jboss/forge/addon/maven/projects/PlexusContainer.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,25 @@ public T call() throws Exception
4848

4949
public void preShutdown(@Observes @Local PreShutdown event)
5050
{
51-
if (plexusContainer != null)
51+
try
52+
{
53+
ClassLoaders.executeIn(Thread.currentThread().getContextClassLoader(), new Callable<Void>()
54+
{
55+
@Override
56+
public Void call() throws Exception
57+
{
58+
if (plexusContainer != null)
59+
{
60+
plexusContainer.dispose();
61+
plexusContainer = null;
62+
}
63+
return null;
64+
}
65+
});
66+
}
67+
catch (Exception e)
5268
{
53-
plexusContainer.dispose();
54-
plexusContainer = null;
69+
throw new RuntimeException("Error encountered while disposing PlexusContainer", e);
5570
}
5671
}
5772

0 commit comments

Comments
 (0)