Details
- 
    Task 
- 
    Resolution: Fixed
- 
    Major 
- 
    0.9.1252
- 
    None
Description
From mailing list:
Hi Xavier,
To use the packager plugin in m2 do the following:
1) Add the xwiki remote repository either to your settings or in your pom.xml file:
  <repositories>
    <repository>
      <id>xwiki</id>
      <name>XWiki Maven2 Remote Repository</name>
      <url>http://maven.xwiki.org</url>
      <releases>
        <enabled>true</enabled>
      </releases>
    </repository>
  </repositories>
2) Then follow the sample located at http://tinyurl.com/yd22mg
This examples uses default locations but you can control the parameters using the following plugin configuration elements:
For import:
    /**
     * @parameter default-value = "xwiki"
     * @see com.xpn.xwiki.tool.backup.Importer#importDocuments(java.io.File,String,java.io.File)
     */
    private String databaseName;
    /**
     * @parameter default-value = "${basedir}/src/main/packager/hibernate.cfg.xml"
     * @see com.xpn.xwiki.tool.backup.Importer#importDocuments(java.io.File,String,java.io.File)
     */
    private File hibernateConfig;
    /**
     * @parameter default-value = "${basedir}/src/main/documents"
     * @see com.xpn.xwiki.tool.backup.Importer#importDocuments(java.io.File,String,java.io.File)
     */
    private File sourceDirectory;
Here's the javadoc for the parameters:
     * @param sourceDirectory the directory where the package.xml file is located and where the
     *        documents to import are located
     * @param databaseName some database name (TODO: find out what this name is really)
     * @param hibernateConfig the Hibernate config fill containing the database definition (JDBC
     *        driver, username and password, etc)
And for export:
    /**
     * @parameter default-value = "xwiki"
     * @see com.xpn.xwiki.tool.backup.Exporter#exportDocuments(java.io.File, String, java.io.File)
     */
    private String databaseName;
    /**
     * @parameter default-value = "${basedir}/src/main/packager/hibernate.cfg.xml"
     * @see com.xpn.xwiki.tool.backup.Exporter#exportDocuments(java.io.File, String, java.io.File)
     */
    private File hibernateConfig;
    /**
     * @parameter default-value = "${project.build.directory}/export"
     * @see com.xpn.xwiki.tool.backup.Exporter#exportDocuments(java.io.File, String, java.io.File)
     */
    private File exportDirectory;
Here's the javadoc for the parameters:
     * @param exportDirectory the directory where to export the documents
     * @param databaseName some database name (TODO: find out what this name is really)
     * @param hibernateConfig the Hibernate config fill containing the database definition (JDBC
     *        driver, username and password, etc)
3) Run mvn xwiki-packager:import  and xwiki-packager:export for import and export