Skip to content
Snippets Groups Projects
Commit 5bad9a02 authored by Vincent Massol's avatar Vincent Massol
Browse files

XWIKI-11773: Exception in the Maven Packager Plugin when installing Admin Tools

parent cf15e814
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
import com.xpn.xwiki.doc.XWikiDocument; import com.xpn.xwiki.doc.XWikiDocument;
import com.xpn.xwiki.web.Utils; import com.xpn.xwiki.web.Utils;
import com.xpn.xwiki.web.XWikiServletRequestStub; import com.xpn.xwiki.web.XWikiServletRequestStub;
import com.xpn.xwiki.web.XWikiServletResponseStub;
import com.xpn.xwiki.web.XWikiServletURLFactory; import com.xpn.xwiki.web.XWikiServletURLFactory;
/** /**
...@@ -80,8 +81,10 @@ public XWikiContext createXWikiContext(String databaseName, File hibernateConfig ...@@ -80,8 +81,10 @@ public XWikiContext createXWikiContext(String databaseName, File hibernateConfig
xcontext.setWikiId(databaseName); xcontext.setWikiId(databaseName);
xcontext.setMainXWiki(databaseName); xcontext.setMainXWiki(databaseName);
// Use a dummy Request even in daemon mode so that XWiki's initialization can create a Servlet URL Factory. // Use a dummy Request/Response even in daemon mode so that XWiki's initialization can create a Servlet URL
// Factory and any code requiring those objects will work.
xcontext.setRequest(new XWikiServletRequestStub()); xcontext.setRequest(new XWikiServletRequestStub());
xcontext.setResponse(new XWikiServletResponseStub());
// Use a dummy URL so that XWiki's initialization can create a Servlet URL Factory. We could also have // Use a dummy URL so that XWiki's initialization can create a Servlet URL Factory. We could also have
// registered a custom XWikiURLFactory against XWikiURLFactoryService but it's more work. // registered a custom XWikiURLFactory against XWikiURLFactoryService but it's more work.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment