[ARCH-57] Maven build not working with 5.5.6 archetypes Created: 06/Sep/17  Updated: 11/Dec/17  Resolved: 11/Dec/17

Status: Closed
Project: Archetypes
Component/s: project
Affects Version/s: 1.2.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Bernhard Dangl Assignee: Unassigned
Resolution: Not an issue Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MAGNOLIA-7148 missing magnolia-bundle-parent - Upda... Open
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

The maven build fails in our current project, when changing to Version 5.5.6 (updating from 5.5).

The maven error is reproducable when starting a plain project with the following steps (based on instructions from https://documentation.magnolia-cms.com/display/DOCS/Module+structure#Modulestructure-Mavenarchetypes):

  • mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=https://nexus.magnolia-cms.com/content/groups/public/ 
  • Using version 5.5.6
  • Changing the resulting pom's
    • Root pom.xml: Use the eebundle (Option B)
    • Webapp pom.xml: Use the magnolia-enterprise-pro-webapp (Option iv)
  • Run
    • mvn clean install

Resulting error:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] test (parent pom) .................................. SUCCESS [  0.255 s]
[INFO] test: webapp ....................................... FAILURE [ 14.380 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.070 s
[INFO] Finished at: 2017-09-06T12:51:06+02:00
[INFO] Final Memory: 32M/232M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project test-webapp: Could not resolve dependencies for project test:test-webapp:war:1.0-SNAPSHOT: Failed to collect dependencies at info.magnolia.eebundle:magnolia-enterprise-pro-webapp:pom:5.5.6 -> info.magnolia.multisite:magnolia-module-multisite:jar:1.2.6: Failed to read artifact descriptor for info.magnolia.multisite:magnolia-module-multisite:jar:1.2.6: Failure to find info.magnolia:magnolia-project:pom:5.4.13 in https://nexus.magnolia-cms.com/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of magnolia.public has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :test-webapp

The error seems to occur up from version 5.5.5. We did not see it in 5.5.1 - 5.5.4.



 Comments   
Comment by Stefan Zeilinger [ 07/Sep/17 ]

the dependency from the magnolia-module-multisite-1.2.5 for magnolia-project changed from version 5.4.1 to 5.4.13
but currently there is no version 5.4.13 available
https://nexus.magnolia-cms.com/content/groups/public/info/magnolia/magnolia-project/

check poms from magnolia-module-multisite:
https://nexus.magnolia-cms.com/content/repositories/magnolia.enterprise.releases/info/magnolia/multisite/magnolia-module-multisite/1.2.4/magnolia-module-multisite-1.2.4.pom
https://nexus.magnolia-cms.com/content/repositories/magnolia.enterprise.releases/info/magnolia/multisite/magnolia-module-multisite/1.2.5/magnolia-module-multisite-1.2.5.pom

Comment by Siegfried Zach [ 07/Sep/17 ]

Thanks to Jan we could identify the reason.
To make it working it is needed to have the repositiory https://nexus.magnolia-cms.com/content/groups/enterprise/ configured.

The root pom.xml from the project arechtype (https://nexus.magnolia-cms.com/content/groups/public/info/magnolia/maven/archetypes/magnolia-project-archetype/1.2.3-SNAPSHOT/) contains:

    <repository>
      <id>magnolia.enterprise.releases</id>
      <url>https://nexus.magnolia-cms.com/content/repositories/magnolia.enterprise.releases</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>

Maybe this should be changed to

<url>https://nexus.magnolia-cms.com/content/groups/enterprise/</url>

which should avoid the problem from above.

Comment by Joscha van der Linden [ 08/Sep/17 ]

We have the same issue.

Comment by Christoph Meier [ 11/Oct/17 ]

I can not confirm the above observations.
I have used the archetype many times yesterday and today to create a custom webapp based on magnolia-enterprise-pro-webapp.

  • Magnolia version using 5.5.6;
  • adapting the produced poms the same way as bdangl.
    • Root pom.xml: Use the eebundle (Option B)
    • Webapp pom.xml: Use the magnolia-enterprise-pro-webapp (Option iv)
  • uncommented the ee-repo section in the root pom (as shown by szach above)

I have repeated it also by explicitly using freshly created ee-maven-settings (avoiding to use my usually mgnl-maven-settings) plus having empty .m2 folder.
Still works fine.

Check the mvn dependency tree of my artifact.
I have no SNAPSHOTs.
magnolia-module-multisite:1.2.6

(Using mvn version 3.2.3)

Comment by Siegfried Zach [ 12/Oct/17 ]

Have you completly cleared your .m2/repositories folder?

Comment by Christoph Meier [ 12/Oct/17 ]

Yes. I have cleared the .m2 folder. See above

Comment by Christoph Meier [ 12/Oct/17 ]

And another correction:
With proper Magnolia ee Maven settings (see Maven setup) the repositories can be simplified. You need only the vaadin-addons. The Magnolia repos should be defined in the Maven settings.xml
I have tried it once again (with ee settings and empty .m2 folder).
Works.
You can check my example on bitbucket (make sure to check the linked bitbucket repo on the 5.6-version tag)

Comment by Siegfried Zach [ 13/Oct/17 ]

Yes - starting with Maven setup is also working. In our case I came newly to the project and had already a custom settings.xml which I did not merge with the one coming from Maven setup, thus I run into this "problem".

My intention is just:

  • In the maven project archetype there is
  • * <repository>
          <id>magnolia.enterprise.releases</id>
          <url>https://nexus.magnolia-cms.com/content/repositories/magnolia.enterprise.releases</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
    
  • and I think the better/more correct url would be <url>https://nexus.magnolia-cms.com/content/groups/enterprise/</url>
  • So I do not fully understand why the Maven Setup uses a different url than the project archetype.

We made this change in our project root pom.xml anyway.

Comment by Michael Dähnert [ 16/Oct/17 ]

I'm sorry for closing this issue accidentally.

Unfortunately I can't reopen it to the right status.

Can someone please reopen this ticket.

Comment by Christoph Meier [ 16/Oct/17 ]

JaXt0r - I can open it again, even if I think we could close it.

Comment by Christoph Meier [ 16/Oct/17 ]

I would like to get a statement from the reporter bernhard.dangl@wunderman.com - I wonder whether his build works with proper Maven settings.

Comment by Bernhard Dangl [ 16/Oct/17 ]

My colleague Siegfried Zach took over this ticket.
He asked the question at https://jira.magnolia-cms.com/browse/ARCH-57?focusedCommentId=149699&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-149699 why the archetype uses a different repository url then the described maven setup.

Comment by Christoph Meier [ 16/Oct/17 ]

bernhard.dangl@wunderman.com, thanks for your reply.

The question from Siegfried Zach I have to check - for sure a valid question.
My first guess is, that both

https://nexus.magnolia-cms.com/content/repositories/magnolia.enterprise.releases

(from archetype)

https://nexus.magnolia-cms.com/content/groups/enterprise/

(from maven settings)
provide similar content - one might be an alias of the other (i have to check this with our devops).

Besides that - concerning the topic of this ticket - I would like to close it and rather create a follow up.

Comment by Siegried Zach [ 16/Oct/17 ]

If nothing speaks against it, I would vote for syncing the urls and using https://nexus.magnolia-cms.com/content/groups/enterprise/ everywhere

Comment by Christoph Meier [ 11/Dec/17 ]

szach, bernhard.dangl@wunderman.com

The repos represented by
https://nexus.magnolia-cms.com/content/repositories/magnolia.enterprise.releases,
https://nexus.magnolia-cms.com/content/groups/enterprise/
are not identical, but one is a subset of the the other.

atm I have no time to dig in whether we it would make sense "syncing the urls".
But I would like to close this ticket - since it is indeed no issue.

If you insist about the URL topic - please create a new ticket.

Generated at Sun Feb 11 23:23:06 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.