Wiki source code of Fill a local Maven repository with the default user interface extensions
Version 1.2 by Clemens Robbenhaar on 2016/01/22
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{warning}}This should only be used if the server in which to install XWiki has no network access, and no other means to install the user interface is available. | ||
2 | {{/warning}} | ||
3 | |||
4 | === Prerequisites === | ||
5 | * a staging / development server which has access to the internet, to collect the necessary resources from there | ||
6 | * a minimal development environment on the staging server including the ##mvn## tool, as if you want to [[build XWiki from Source>>doc:dev:Community.Building]] | ||
7 | * a way to copy the resources from the staging to the production server | ||
8 | * write access to the ##xwiki.properties## on the server | ||
9 | |||
10 | |||
11 | === Download the UI resources === | ||
12 | |||
13 | First make sure that you have the right ##settings.xml## on the staging server, which has the XWiki repositories enabled. | ||
14 | You also might want to move away your current ##$HOME/.m2/repository## temporarily to mimimize the amount of files to be transferred to production later. | ||
15 | |||
16 | Create an empty directory and place the following file as ##pom.xml## in it: | ||
17 | |||
18 | {{code}} | ||
19 | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
20 | <modelVersion>4.0.0</modelVersion> | ||
21 | <parent> | ||
22 | <groupId>org.xwiki.commons</groupId> | ||
23 | <artifactId>xwiki-commons-pom</artifactId> | ||
24 | <version>7.4</version> | ||
25 | </parent> | ||
26 | <groupId>never-mind</groupId> | ||
27 | <artifactId>never-mind</artifactId> | ||
28 | <version>0.0</version> | ||
29 | <name>dummy download package</name> | ||
30 | <packaging>pom</packaging> | ||
31 | <dependencies> | ||
32 | <dependency> | ||
33 | <groupId>org.xwiki.enterprise</groupId> | ||
34 | <artifactId>xwiki-enterprise-ui-mainwiki</artifactId> | ||
35 | <version>7.4</version> | ||
36 | <type>xar</type> | ||
37 | </dependency> | ||
38 | </dependencies> | ||
39 | </project> | ||
40 | {{/code}} | ||
41 | |||
42 | Make sure to update the version numbers (here ##7.4##) in both the ##<parent>## and the ##<dependencies>##. | ||
43 | |||
44 | Open a command line, change to the directory created in the previous step and issue the command: | ||
45 | |||
46 | {{code}}mvn clean install{{/code}} | ||
47 | |||
48 | This will fail with an error message like: | ||
49 | |||
50 | {{code}} | ||
51 | [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (enforce-valid-poms) on project never-mind: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1] | ||
52 | {{/code}} | ||
53 | |||
54 | Never mind; as long as it has downloaded the "dependencies" you are set for the next step. | ||
55 | |||
56 | === Install the resources on the server === | ||
57 | |||
58 | As the next step, copy the complete ##~/.m2/repository## to a directory on the production server where the user running the XWiki webapp can read it. | ||
59 | (**TODO:** figure out if only parts of the directory are sufficient, i.e. ##~/.m2/repository/org/xwiki##) | ||
60 | |||
61 | Configure in the ##xwiki.properties## the destination directory on the server as the "main xwiki" repository: | ||
62 | |||
63 | {{code}} | ||
64 | extension.repositories=maven-xwiki:maven:file:/path/to/copy/of/the/.m2/repository | ||
65 | {{/code}} | ||
66 | |||
67 | Restart the server (if already running), remove/move away the "permanent directory" (wherever the property ##${environment.permanentDirectory}## points to) - just in case it remembers previous failed install attempt (when upgrading, better only move aside ##${environment.permanentDirectory}/jobs## ) - and access XWiki via the browser to see if the distribution wizard comes up again. | ||
68 | |||
69 | This time it should find the necessary files from the local repository and install the UI. |