[DOCU-698] Update Maven setup page Created: 16/Mar/16  Updated: 27/Jun/16  Resolved: 11/Apr/16

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Neutral
Reporter: Christoph Meier Assignee: Martin DrĂ¡pela
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:
Sprint: Docu Sprint 10

 Description   

Page: https://documentation.magnolia-cms.com/display/DEV/Maven+setup explains Magnolia specific Maven setup for 4 different user groups / having access to

  • CE-users - access to Magnolia public repository only
  • forge-users - access to protected Magnolia repo for artifacts under forge license
  • EE-users - protected Magnolia repo for enterprise licensed artifacts
  • magnolia-employee - access to forge, enterprise and magnolia internal artifacts

Combinations of forge- and EE-users exist as well.

Fix "recipe"

The worst thing on the page a.t.m.: The "recipe" explaining how to create the Maven settings.xml isn't working anymore.

Current description (not working)

  • generate settings (for a magnolia employee)
  • create password encryption

Workaround:

  • Create generate settings for CE user
  • Create password encryption
  • Create generate settings for EE || magnolia employee || forge user

First i'm also curious whether mdrapela with his linux machine can confirm the "bug" / aka no more working recipe.
I expect the confirmation of the "bug". In this case we should describe the workaround.

Furthermore we should analyze why it is failing - however that's beyond the scope of this ticket.
cmeier may have a look at the maven templates or checking it up with an internal maven evangelist.

The Install Maven section

In this section, doc says:
??For OS specific installations see Apache Maven Project. ??
The link doesn't respond with 404 but doesn't show a useful content. Please check at Maven page whether there's something better to link. If there's none, let's see ...



 Comments   
Comment by Martin DrĂ¡pela [ 06/Apr/16 ]

Maven configuration on a linux machine

Configuring MAVEN 3.2.3 (successfully tested also for version 3.3.9) can be accomplished by following this procedure (tested with Java 1.7 OpenJDK, on Lubuntu 15.10 (version 4.2.0-16-generic, i386).

On Linux, installation of MAVEN basically just means unpacking the gzipped binaries into a folder of your choice and modifying the PATH variable so that the mvn command can find the unpacked binaries. No ".m2" folder will be auto-generated in this phase of course.

  1. CE users: jump immediately to step 4)
  2. manually create "/home/USER_HOME/.m2/" directory
  3. encrypt your password as stated in the documentation ("Enable password encryption"). A security file will be created in the .m2 directory.
  4. proceed with the Maven Init command specified for your user group (CE, EE, Forge, Internal) as stated in the documentation.

[Please note that a test build "Test the Maven Nexus settings", recommended as the next step in MAVEN configuration for the EE users, will produce errors (discussed also here: https://jira.magnolia-cms.com/browse/SYS-1115 with a follow-up https://jira.magnolia-cms.com/browse/MGNLUI-1908).

Comment by Christoph Meier [ 06/Apr/16 ]

Here are my findings about doing the procedure on a Mac
Unfortunately, the solution found by Martin for Linux doesn't help on a mac, if if there is no valid .m2/settings.xml yet.

So: For new maven user without existing settings, do the following:

For CE user:

  • Run the command
    mvn org.sonatype.plugins:nexus-m2settings-maven-plugin:1.6.5:download -DnexusUrl=https://nexus.magnolia-cms.com
  • make sure to select the option "magnolia-community-public"
  • enter anonymous for both username and password when prompted (this is required!)

For all other groups
For all groups with access to restricted repositories which requires authentication, on a mac, if there is no valid .m2/settings.xml, a user still must follow the "workaround", (creating the .m2/ dir is not helping):

  • Do the setup for CE users (see above)
  • Create password encryption (if desired)
  • Run the command
    mvn org.sonatype.plugins:nexus-m2settings-maven-plugin:1.6.5:download -DnexusUrl=https://nexus.magnolia-cms.com
    and select the appropriate group
Comment by Christoph Meier [ 11/Apr/16 ]

I was on the way testing the new setup page ... however ... it looks like either templates or nexus settings or both need some minor adjustments.
As soon as that's done, i'll proceed with my tests and will finish the review of this ticket.

Comment by Christoph Meier [ 27/Jun/16 ]

So.
Right now, the Maven setup with its recipe works again. To create the settings.xml works again, and the whole set-up page has become smaller and hopefully better understandable.

User may still encounter an issue with Maven failing to downloads some artifacts from vaadin-addons. However, the issue and a workaround are described on the new Maven setup page, and the issue should not happen again with Magnolia UI 5.4.8+ and 5.5+

Comment by Christoph Meier [ 27/Jun/16 ]

I have applied the last versions of the new page from mdrapela to the "old" existing page. (The temp. copy page i have deleted.)

Generated at Mon Feb 12 01:11:35 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.