Don't build DXA, OK?

What has happened?

Some developers clone a DXA Github repository, and build DXA locally from sources while they just want to create a web application based on DXA.

This is an extra-step which you don’t really need. It's already built for you.

 

NOTE: OK, if you want to develop the DXA itself, you still need the source code, but this is a different story

I need DXA jars! I have to build DXA!

You don’t have to. DXA releases are in Maven Central, let Maven do its work to resolve dependencies for you.

If you want to stay on the latest updates, there is an option for you as well: DXA Snapshots are also published nightly.

NOTE: Snapshots reflect the current development version. They may be not stable.

NOTE: if you want to use SNAPSHOTs, you need to configure your Maven to use https://oss.sonatype.org/content/repositories/snapshots as a snapshot artifactory.

I have already tried to use Maven Central, it failed to download artifacts, DXA doesn’t work!

If does.

  1. Check your dependencies (at this moment, the latest release is DXA 1.5.0, the lastest snapshot is 1.6.0-SNAPSHOT)

  2. After a failed attempt, Maven caches this. This might be a problem.

  • Release versions can be easily refreshed if you just clean your repository, and let Maven download everything again.
  • Snapshots can be updated just with a simple flag -U. 
    // maven’s flag -U forces to update snapshots
    mvn package -U

I changed DXA code and build my custom dxa-artifact:1.5.0 but DXA uses your version, overriding mine.

Of course it does.

The principal idea of Maven is that org.example:my-cool-project:1.5.0 is exactly the same in every single repository in this world.

If you want your custom build, change the version.