maven question

I am currently struggling to build dhis2 correctly :frowning: I think it reflects my fairly thin grasp on the workings of maven.

Let me retrace my steps:

  1. cd
    mvn clean install -Dtest=skip -DfailIfNoTests=false

  2. cd dhis-web
    mvn clean install -Dtest=skip -DfailIfNoTests=false

  3. cd dhis-web-portal (this step is not necessary but I’ll do out of superstition)
    mvn clean install -Dtest=skip -DfailIfNoTests=false

Now the problem is that I keep ending up with an old version of dhis-service-aggregationengine-default-2.0.3-SNAPSHOT.jar packed into dhis.war. I see from step 1 that I have definitely built a new version. Anybody got a clue why this is? Am I doing something stupid?

Bob.

I am having the same problem.

DHIS fails to launch with the latest version of the source code.

···

On Fri, Oct 30, 2009 at 12:22 PM, Bob Jolliffe <bobjolliffe@gmail.com> wrote:

I am currently struggling to build dhis2 correctly :frowning: I think it reflects
my fairly thin grasp on the workings of maven.

Let me retrace my steps:

1. cd <src dir of dhis2>
mvn clean install -Dtest=skip -DfailIfNoTests=false

2. cd dhis-web
mvn clean install -Dtest=skip -DfailIfNoTests=false

3. cd dhis-web-portal (this step is not necessary but I'll do out of
superstition)
mvn clean install -Dtest=skip -DfailIfNoTests=false

Now the problem is that I keep ending up with an old version of
dhis-service-aggregationengine-default-2.0.3-SNAPSHOT.jar packed into
dhis.war. I see from step 1 that I have definitely built a new version.
Anybody got a clue why this is? Am I doing something stupid?

Bob.

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

I have found that when I manually replace dhis-service-

aggregationengine-default-2.0.3-SNAPSHOT.jar in the dhis.war it runs. So the problem is definitely related to this file. Something maven is not doing. Should be simple enough to isolate but I can’t see it. Still looking …

Cheers
Bob

···

2009/10/30 Jason Pickering jason.p.pickering@gmail.com

I am having the same problem.

DHIS fails to launch with the latest version of the source code.

On Fri, Oct 30, 2009 at 12:22 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

I am currently struggling to build dhis2 correctly :frowning: I think it reflects

my fairly thin grasp on the workings of maven.

Let me retrace my steps:

  1. cd

mvn clean install -Dtest=skip -DfailIfNoTests=false

  1. cd dhis-web

mvn clean install -Dtest=skip -DfailIfNoTests=false

  1. cd dhis-web-portal (this step is not necessary but I’ll do out of

superstition)

mvn clean install -Dtest=skip -DfailIfNoTests=false

Now the problem is that I keep ending up with an old version of

dhis-service-aggregationengine-default-2.0.3-SNAPSHOT.jar packed into

dhis.war. I see from step 1 that I have definitely built a new version.

Anybody got a clue why this is? Am I doing something stupid?

Bob.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

ok. I see it is not listed as a dependency in the web-commons pom.xml. This looks like the problem as all the others are there. When I add it in I am getting a problem

‘dependencies.dependency.version’ is missing for org.hisp.dhis:dhis-service-aggregationengine-default

Can’t quite figure this out as I thought depency info is coming from parent project. Still looking …

Cheers
Bob

···

2009/10/30 Bob Jolliffe bobjolliffe@gmail.com

I have found that when I manually replace dhis-service-
aggregationengine-default-2.0.3-SNAPSHOT.jar in the dhis.war it runs. So the problem is definitely related to this file. Something maven is not doing. Should be simple enough to isolate but I can’t see it. Still looking …

Cheers
Bob

2009/10/30 Jason Pickering jason.p.pickering@gmail.com

I am having the same problem.

DHIS fails to launch with the latest version of the source code.

On Fri, Oct 30, 2009 at 12:22 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

I am currently struggling to build dhis2 correctly :frowning: I think it reflects

my fairly thin grasp on the workings of maven.

Let me retrace my steps:

  1. cd

mvn clean install -Dtest=skip -DfailIfNoTests=false

  1. cd dhis-web

mvn clean install -Dtest=skip -DfailIfNoTests=false

  1. cd dhis-web-portal (this step is not necessary but I’ll do out of

superstition)

mvn clean install -Dtest=skip -DfailIfNoTests=false

Now the problem is that I keep ending up with an old version of

dhis-service-aggregationengine-default-2.0.3-SNAPSHOT.jar packed into

dhis.war. I see from step 1 that I have definitely built a new version.

Anybody got a clue why this is? Am I doing something stupid?

Bob.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Problem was that the aggregationengine dependency was not included in the dependency management section in the root pom. Instead it was defined with version directly in the dhis-web-excelreporting project. I wanted to phase out that project but the VN team needs it for the excel reporting module, so I guess someone just forgot to define it in the root.

FYI the purpose of dependency management mechanism defined in the root pom is to make all dependencies, including transitive, inherit its settings. This is especially useful for the version attribute, both for upgrading the version of libs using throughout the application and controlling the version of third-party, transitive libs. Maven is your friend:-)

Lars

···

On Fri, Oct 30, 2009 at 12:06 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

ok. I see it is not listed as a dependency in the web-commons pom.xml. This looks like the problem as all the others are there. When I add it in I am getting a problem

‘dependencies.dependency.version’ is missing for org.hisp.dhis:dhis-service-aggregationengine-default

Can’t quite figure this out as I thought depency info is coming from parent project. Still looking …

Cheers
Bob

ok. I see it is not listed as a dependency in the web-commons pom.xml. This looks like the problem as all the others are there. When I add it in I am getting a problem

‘dependencies.dependency.version’ is missing for org.hisp.dhis:dhis-service-aggregationengine-default

Can’t quite figure this out as I thought depency info is coming from parent project. Still looking …

Cheers
Bob

Problem was that the aggregationengine dependency was not included in the dependency management section in the root pom. Instead it was defined with version directly in the dhis-web-excelreporting project. I wanted to phase out that project but the VN team needs it for the excel reporting module, so I guess someone just forgot to define it in the root.

FYI the purpose of dependency management mechanism defined in the root pom is to make all dependencies, including transitive, inherit its settings. This is especially useful for the version attribute, both for upgrading the version of libs using throughout the application and controlling the version of third-party, transitive libs.

Yes I realize this. But I figured that if it was being built that the dependency MUST be in the pom.xml. I see that’s not the case.

Maven is your friend:-)

With friend like this … :slight_smile: But I do agree (sort of).

Regards
Bob

···

2009/10/30 Lars Helge Øverland larshelge@gmail.com

On Fri, Oct 30, 2009 at 12:06 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Lars

Fine that you’re superstitious Bob, but this (rather time consuming, unless you need time to get another cup of coffee) step is exactly the same as the last process taking place in step 2 above since the portal is defined as a the last module in dhis-web/pom.xml, so your dhis.war will already be in dhis-web/dhis-web-portal/target after step 2.

Given all the problems with pom.xml files lately (the portal mess was just a few weeks ago) and the expressed unfriendliness towards Maven among some of the developers it seems there is a need for a How we use/take advantage of maven in DHIS 2 guide to better spread the gospel. I guess it should be part of the technical documentation, if it not already there.

As a start, would a few explaining comments in the two root pom’s maybe help?

I am not saying that you all have to love maven, but would be good if everyone knew how to use it.

Ola

···

2009/10/30 Bob Jolliffe bobjolliffe@gmail.com

I am currently struggling to build dhis2 correctly :frowning: I think it reflects my fairly thin grasp on the workings of maven.

Let me retrace my steps:

  1. cd
    mvn clean install -Dtest=skip -DfailIfNoTests=false

  2. cd dhis-web
    mvn clean install -Dtest=skip -DfailIfNoTests=false

  3. cd dhis-web-portal (this step is not necessary but I’ll do out of superstition)
    mvn clean install -Dtest=skip -DfailIfNoTests=false


Now the problem is that I keep ending up with an old version of dhis-service-aggregationengine-default-2.0.3-SNAPSHOT.jar packed into dhis.war. I see from step 1 that I have definitely built a new version. Anybody got a clue why this is? Am I doing something stupid?

Bob.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Fine that you’re superstitious Bob, but this (rather time consuming, unless you need time to get another cup of coffee) step is exactly the same as the last process taking place in step 2 above since the portal is defined as a the last module in dhis-web/pom.xml, so your dhis.war will already be in dhis-web/dhis-web-portal/target after step 2.

Given all the problems with pom.xml files lately (the portal mess was just a few weeks ago) and the expressed unfriendliness towards Maven among some of the developers it seems there is a need for a How we use/take advantage of maven in DHIS 2 guide to better spread the gospel. I guess it should be part of the technical documentation, if it not already there.

The project structure and the two root POMs are explained on page 4 in the technical doc.

Maven provides a lot of very useful things, like dependency management, build process management and common project structure which makes life easier. Thinking of the alternatives I definitely don’t want to abandon it.

I am not suggesting to anyone we should abandon it. Just that I still struggle occasionally … in fact I fight with it. But I think the fight is worth it. Has much the same functionality as FeeBSD ports system which is good. Though FreeBSD ports are implemented with make which I still understand better :slight_smile:

···

2009/10/30 Lars Helge Øverland larshelge@gmail.com

Fine that you’re superstitious Bob, but this (rather time consuming, unless you need time to get another cup of coffee) step is exactly the same as the last process taking place in step 2 above since the portal is defined as a the last module in dhis-web/pom.xml, so your dhis.war will already be in dhis-web/dhis-web-portal/target after step 2.

Given all the problems with pom.xml files lately (the portal mess was just a few weeks ago) and the expressed unfriendliness towards Maven among some of the developers it seems there is a need for a How we use/take advantage of maven in DHIS 2 guide to better spread the gospel. I guess it should be part of the technical documentation, if it not already there.

The project structure and the two root POMs are explained on page 4 in the technical doc.

Maven provides a lot of very useful things, like dependency management, build process management and common project structure which makes life easier. Thinking of the alternatives I definitely don’t want to abandon it.

You are getting to that age, Bob, where everything was better in the old days :slight_smile:

Cheers,
Jo

···

Den 30. okt. 2009 kl. 13.35 skrev Bob Jolliffe:

I am not suggesting to anyone we should abandon it. Just that I still struggle occasionally ... in fact I fight with it. But I think the fight is worth it. Has much the same functionality as FeeBSD ports system which is good. Though FreeBSD ports are implemented with make which I still understand better :slight_smile:

bad sign I know …

mind you I never said make was better. Just I understand it better. And FreeBSD ports still work in the present - rather well in fact :slight_smile:

···

2009/10/30 Jo Størset storset@gmail.com

Den 30. okt. 2009 kl. 13.35 skrev Bob Jolliffe:

I am not suggesting to anyone we should abandon it. Just that I still struggle occasionally … in fact I fight with it. But I think the fight is worth it. Has much the same functionality as FeeBSD ports system which is good. Though FreeBSD ports are implemented with make which I still understand better :slight_smile:

You are getting to that age, Bob, where everything was better in the old days :slight_smile:

Cheers,

Jo