| 182 | | </section> |
|---|
| 183 | | |
|---|
| 184 | | <section xml:id="archetypes-configuration-maven"> |
|---|
| 185 | | <title>Maven settings</title> |
|---|
| 186 | | |
|---|
| 187 | | <para><emphasis>We assume you have fulfilled the aforementioned |
|---|
| 188 | | prerequisite.</emphasis></para> |
|---|
| 189 | | |
|---|
| 190 | | <para>You need to setup Maven to access Nuxeo's repositories. This is |
|---|
| 191 | | done by adding (or modifying) a Nuxeo profile in your |
|---|
| 192 | | <filename>~/.m2/settings.xml</filename> file.</para> |
|---|
| 193 | | |
|---|
| 194 | | <para><programlisting language="xml"><settings> |
|---|
| 195 | | |
|---|
| 196 | | <profiles> |
|---|
| 197 | | <profile> |
|---|
| 198 | | <id>Nuxeo</id> |
|---|
| 199 | | |
|---|
| 200 | | <properties> |
|---|
| 201 | | <downloadSources>true</downloadSources> |
|---|
| 202 | | </properties> |
|---|
| 203 | | |
|---|
| 204 | | <repositories> |
|---|
| 205 | | <repository> |
|---|
| 206 | | <id>central_proxy</id> |
|---|
| 207 | | <url>http://archiva.nuxeo.org/archiva/repository/central</url> |
|---|
| 208 | | <snapshots> |
|---|
| 209 | | <enabled>false</enabled> |
|---|
| 210 | | </snapshots> |
|---|
| 211 | | </repository> |
|---|
| 212 | | <repository> |
|---|
| 213 | | <id>external_snapshot</id> |
|---|
| 214 | | <url>http://archiva.nuxeo.org/archiva/repository/external_snapshot</url> |
|---|
| 215 | | <releases> |
|---|
| 216 | | <enabled>false</enabled> |
|---|
| 217 | | </releases> |
|---|
| 218 | | </repository> |
|---|
| 219 | | <repository> |
|---|
| 220 | | <id>nuxeo_release</id> |
|---|
| 221 | | <url>http://archiva.nuxeo.org/archiva/repository/nuxeo_release</url> |
|---|
| 222 | | <snapshots> |
|---|
| 223 | | <enabled>false</enabled> |
|---|
| 224 | | </snapshots> |
|---|
| 225 | | </repository> |
|---|
| 226 | | <repository> |
|---|
| 227 | | <id>nuxeo_snapshot</id> |
|---|
| 228 | | <url>http://archiva.nuxeo.org/archiva/repository/nuxeo_snapshot</url> |
|---|
| 229 | | <releases> |
|---|
| 230 | | <enabled>false</enabled> |
|---|
| 231 | | </releases> |
|---|
| 232 | | </repository> |
|---|
| 233 | | </repositories> |
|---|
| 234 | | <pluginRepositories> |
|---|
| 235 | | <pluginRepository> |
|---|
| 236 | | <id>central_proxy</id> |
|---|
| 237 | | <url>http://archiva.nuxeo.org/archiva/repository/central</url> |
|---|
| 238 | | <snapshots> |
|---|
| 239 | | <enabled>false</enabled> |
|---|
| 240 | | </snapshots> |
|---|
| 241 | | </pluginRepository> |
|---|
| 242 | | <pluginRepository> |
|---|
| 243 | | <id>external_snapshot</id> |
|---|
| 244 | | <url>http://archiva.nuxeo.org/archiva/repository/external_snapshot</url> |
|---|
| 245 | | <releases> |
|---|
| 246 | | <enabled>false</enabled> |
|---|
| 247 | | </releases> |
|---|
| 248 | | </pluginRepository> |
|---|
| 249 | | <pluginRepository> |
|---|
| 250 | | <id>nuxeo_release</id> |
|---|
| 251 | | <url>http://archiva.nuxeo.org/archiva/repository/nuxeo_release</url> |
|---|
| 252 | | <snapshots> |
|---|
| 253 | | <enabled>false</enabled> |
|---|
| 254 | | </snapshots> |
|---|
| 255 | | </pluginRepository> |
|---|
| 256 | | <pluginRepository> |
|---|
| 257 | | <id>nuxeo_snapshot</id> |
|---|
| 258 | | <url>http://archiva.nuxeo.org/archiva/repository/nuxeo_snapshot</url> |
|---|
| 259 | | <releases> |
|---|
| 260 | | <enabled>false</enabled> |
|---|
| 261 | | </releases> |
|---|
| 262 | | </pluginRepository> |
|---|
| 263 | | </pluginRepositories> |
|---|
| 264 | | |
|---|
| 265 | | </profile> |
|---|
| 266 | | </profiles> |
|---|
| 267 | | |
|---|
| 268 | | <activeProfiles> |
|---|
| 269 | | <activeProfile>Nuxeo</activeProfile> |
|---|
| 270 | | </activeProfiles> |
|---|
| 271 | | |
|---|
| 272 | | </settings></programlisting> Note that the <varname>Nuxeo</varname> |
|---|
| 273 | | profile is activated.</para> |
|---|
| 274 | | |
|---|
| 275 | | <para>Due to the Maven <link |
|---|
| 276 | | xlink:href="http://jira.codehaus.org/browse/MNG-3099">bug |
|---|
| 277 | | MNG-3099</link> the <varname>Nuxeo</varname> profile will be used with |
|---|
| 278 | | archetype plugin only with a small workaround. You must either specify |
|---|
| 279 | | the remote repository (using -DremoteRepositories) or create a |
|---|
| 280 | | <filename>dummy.xml</filename> POM file, with the following content: |
|---|
| 281 | | <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> |
|---|
| 282 | | <project> |
|---|
| 283 | | <modelVersion>4.0.0</modelVersion> |
|---|
| 284 | | <groupId>com.example</groupId> |
|---|
| 285 | | <artifactId>MNG-2261-workaround</artifactId> |
|---|
| 286 | | <packaging>pom</packaging> |
|---|
| 287 | | <version>1</version> |
|---|
| 288 | | </project></programlisting></para> |
|---|
| 289 | | </section> |
|---|
| | 179 | |
|---|
| | 180 | </section> |
|---|
| | 181 | |
|---|
| 301 | | language="xml">mvn archetype:create -DartifactId=my-project -DgroupId=com.company.sandbox \ |
|---|
| 302 | | -DarchetypeArtifactId=nuxeo-archetype-simple \ |
|---|
| 303 | | -DarchetypeGroupId=org.nuxeo.archetypes \ |
|---|
| 304 | | -DarchetypeVersion=5.1-SNAPSHOT \ |
|---|
| 305 | | -f /path/to/dummy.xml</programlisting> or <programlisting language="xml">mvn archetype:create -DartifactId=my-project -DgroupId=com.company.sandbox \ |
|---|
| 306 | | -DarchetypeArtifactId=nuxeo-archetype-simple \ |
|---|
| 307 | | -DarchetypeGroupId=org.nuxeo.archetypes \ |
|---|
| 308 | | -DarchetypeVersion=5.1-SNAPSHOT \ |
|---|
| 309 | | -DremoteRepositories=http://archiva.nuxeo.org/archiva/repository/nuxeo_snapshot</programlisting></para> |
|---|
| 310 | | |
|---|
| 311 | | <para>You can see there are five or six arguments you need to |
|---|
| 312 | | supply:</para> |
|---|
| | 193 | language="xml">mvn archetype:create -DartifactId=my-project \ |
|---|
| | 194 | -DgroupId=com.company.sandbox \ |
|---|
| | 195 | -DarchetypeArtifactId=nuxeo-archetype-simple \ |
|---|
| | 196 | -DarchetypeGroupId=org.nuxeo.archetypes \ |
|---|
| | 197 | -DarchetypeVersion=5.1-SNAPSHOT \ |
|---|
| | 198 | -DremoteRepositories=http://archiva.nuxeo.org/archiva/repository/nuxeo_snapshot,http://archiva.nuxeo.org/archiva/repository/nuxeo_release</programlisting></para> |
|---|
| | 199 | |
|---|
| | 200 | <para>You can see there are six arguments you need to supply:</para> |
|---|
| 338 | | (5.1-M2, 5.1-M3, 5.1.0, 5.1.2, 5.1-SNAPSHOT, ...).</para> |
|---|
| 339 | | </listitem> |
|---|
| 340 | | |
|---|
| 341 | | <listitem> |
|---|
| 342 | | <para><emphasis>remoteRepositories</emphasis>: (optional) the |
|---|
| 343 | | repository from which download the archetype. If specified, |
|---|
| 344 | | there is no need of the dummy.xml file workaround.</para> |
|---|
| 345 | | </listitem> |
|---|
| 346 | | </itemizedlist><note> |
|---|
| 347 | | <para>The <filename>-f /path/to/dummy.xml</filename> is the |
|---|
| 348 | | temporary workaround for Maven <link |
|---|
| 349 | | xlink:href="http://jira.codehaus.org/browse/MNG-3099">bug |
|---|
| 350 | | MNG-3099</link> (see Maven settings above). If you know the remote |
|---|
| 351 | | repository URL, use instead |
|---|
| 352 | | <emphasis>-DremoteRepositories</emphasis></para> |
|---|
| 353 | | </note></para> |
|---|
| | 228 | (5.1-M2, 5.1-M3, 5.1.0, 5.1.2, 5.1.3, 5.1-SNAPSHOT, ...).</para> |
|---|
| | 229 | </listitem> |
|---|
| | 230 | |
|---|
| | 231 | <listitem> |
|---|
| | 232 | <para><emphasis>remoteRepositories</emphasis>: the |
|---|
| | 233 | repository from which download the archetype.</para> |
|---|
| | 234 | </listitem> |
|---|
| | 235 | </itemizedlist> |
|---|
| | 236 | </para> |
|---|
| 356 | | my-project/ |
|---|
| 357 | | |-- build.properties.sample |
|---|
| 358 | | |-- build.xml |
|---|
| 359 | | |-- pom.xml |
|---|
| 360 | | `-- src |
|---|
| 361 | | `-- main |
|---|
| 362 | | |-- java |
|---|
| 363 | | | `-- com |
|---|
| 364 | | | `-- company |
|---|
| 365 | | | `-- sandbox |
|---|
| 366 | | | |-- SampleAction.java |
|---|
| 367 | | | |-- SampleActionBean.java |
|---|
| 368 | | | `-- SampleEventListener.java |
|---|
| 369 | | `-- resources |
|---|
| 370 | | |-- META-INF |
|---|
| 371 | | | |-- MANIFEST.MF |
|---|
| 372 | | | `-- ejb-jar.xml |
|---|
| 373 | | |-- OSGI-INF |
|---|
| 374 | | | |-- actions-contrib.xml |
|---|
| 375 | | | |-- core-types-contrib.xml |
|---|
| 376 | | | |-- deployment-fragment.xml |
|---|
| 377 | | | |-- directories-contrib.xml |
|---|
| 378 | | | |-- ecm-types-contrib.xml |
|---|
| 379 | | | |-- event-listener-contrib.xml |
|---|
| 380 | | | |-- l10n |
|---|
| 381 | | | | |-- messages_en.properties |
|---|
| 382 | | | | `-- messages_fr.properties |
|---|
| 383 | | | |-- lifecycle-contrib.xml |
|---|
| 384 | | | `-- theme-contrib.xml |
|---|
| 385 | | |-- directories |
|---|
| 386 | | | `-- sample_languages.csv |
|---|
| 387 | | |-- nuxeo.war |
|---|
| 388 | | | `-- incl |
|---|
| 389 | | | `-- tabs |
|---|
| 390 | | | `-- sample_view.xhtml |
|---|
| 391 | | |-- schemas |
|---|
| 392 | | | `-- sample.xsd |
|---|
| 393 | | |-- seam.properties |
|---|
| 394 | | `-- themes |
|---|
| 395 | | `-- nxthemes-setup.xml |
|---|
| | 239 | my-project |
|---|
| | 240 | |-- build.properties.sample |
|---|
| | 241 | |-- build.xml |
|---|
| | 242 | |-- pom.xml |
|---|
| | 243 | |-- settings.xml |
|---|
| | 244 | `-- src |
|---|
| | 245 | `-- main |
|---|
| | 246 | |-- java |
|---|
| | 247 | | `-- com |
|---|
| | 248 | | `-- company |
|---|
| | 249 | | `-- sandbox |
|---|
| | 250 | | |-- BookEventListener.java |
|---|
| | 251 | | |-- BookFileManagerPlugin.java |
|---|
| | 252 | | |-- BookISBNEventListener.java |
|---|
| | 253 | | |-- BookIntegerConverter.java |
|---|
| | 254 | | |-- BookIntegerValidator.java |
|---|
| | 255 | | |-- BookManager.java |
|---|
| | 256 | | |-- BookManagerBean.java |
|---|
| | 257 | | |-- BookResultsProvider.java |
|---|
| | 258 | | |-- BookTitleDescriptor.java |
|---|
| | 259 | | |-- BookTitleService.java |
|---|
| | 260 | | `-- BookTitleServiceImpl.java |
|---|
| | 261 | `-- resources |
|---|
| | 262 | |-- META-INF |
|---|
| | 263 | | |-- MANIFEST.MF |
|---|
| | 264 | | `-- ejb-jar.xml |
|---|
| | 265 | |-- OSGI-INF |
|---|
| | 266 | | |-- actions-contrib.xml |
|---|
| | 267 | | |-- booktitle-contrib.xml |
|---|
| | 268 | | |-- booktitle-service-contrib.xml |
|---|
| | 269 | | |-- content-template-contrib.xml |
|---|
| | 270 | | |-- core-types-contrib.xml |
|---|
| | 271 | | |-- deployment-fragment.xml |
|---|
| | 272 | | |-- directories-contrib.xml |
|---|
| | 273 | | |-- event-listener-contrib.xml |
|---|
| | 274 | | |-- filemanager-contrib.xml |
|---|
| | 275 | | |-- l10n |
|---|
| | 276 | | | |-- messages.properties |
|---|
| | 277 | | | |-- messages_en.properties |
|---|
| | 278 | | | `-- messages_fr.properties |
|---|
| | 279 | | |-- lifecycle-contrib.xml |
|---|
| | 280 | | |-- querymodel-contrib.xml |
|---|
| | 281 | | |-- resultsprovider-contrib.xml |
|---|
| | 282 | | |-- search-contrib.xml |
|---|
| | 283 | | |-- theme-contrib.xml |
|---|
| | 284 | | `-- ui-types-contrib.xml |
|---|
| | 285 | |-- directories |
|---|
| | 286 | | `-- book_keywords.csv |
|---|
| | 287 | |-- nuxeo.war |
|---|
| | 288 | | |-- bookwizard.xhtml |
|---|
| | 289 | | `-- incl |
|---|
| | 290 | | |-- book_listing_fragment.xhtml |
|---|
| | 291 | | |-- bookwizard_page1.xhtml |
|---|
| | 292 | | |-- bookwizard_page2.xhtml |
|---|
| | 293 | | |-- bookwizard_page3.xhtml |
|---|
| | 294 | | `-- tabs |
|---|
| | 295 | | |-- book_view.xhtml |
|---|
| | 296 | | `-- folder_books_view.xhtml |
|---|
| | 297 | |-- schemas |
|---|
| | 298 | | `-- book.xsd |
|---|
| | 299 | |-- seam.properties |
|---|
| | 300 | `-- themes |
|---|
| | 301 | `-- theme-book.xml |
|---|
| 397 | | |
|---|
| 398 | | <para>You should create a <filename>build.properties</filename> file |
|---|
| 399 | | on the base of the <filename>build.properties.sample</filename> so |
|---|
| 400 | | that <varname>jboss.dir</varname> points to your jboss path. This will |
|---|
| 401 | | be used to send the packaged file in the good directory at deployment |
|---|
| 402 | | time. Note that when using the Nuxeo EP 5 installer, the JBOSS home |
|---|
| 403 | | directory is the same as the Nuxeo EP 5 home directory.</para> |
|---|
| 404 | | </section> |
|---|
| | 303 | </section> |
|---|
| | 304 | |
|---|
| | 305 | <section xml:id="archetypes-configuration-maven"> |
|---|
| | 306 | <title>Maven and Ant settings</title> |
|---|
| | 307 | |
|---|
| | 308 | <para>You need to setup Maven to access Nuxeo's repositories. This is |
|---|
| | 309 | done by adding (or modifying) a Nuxeo profile in your |
|---|
| | 310 | <filename>$HOME/.m2/settings.xml</filename> file. Your generated project contains |
|---|
| | 311 | a <filename>settings.xml</filename> file example.</para> |
|---|
| | 312 | |
|---|
| | 313 | <para>You should create a <filename>build.properties</filename> file on |
|---|
| | 314 | the base of the <filename>build.properties.sample</filename> so that |
|---|
| | 315 | <varname>jboss.dir</varname> points to your jboss path. This will be |
|---|
| | 316 | used by <application>Ant</application> to send the packaged file in the |
|---|
| | 317 | good directory at deployment time. Note that when using the Nuxeo EP 5 |
|---|
| | 318 | installer, the JBOSS home directory is the same as the Nuxeo EP 5 home |
|---|
| | 319 | directory.</para> |
|---|