I am currently struggling to build dhis2 correctly I think it reflects my fairly thin grasp on the workings of maven.
Let me retrace my steps:
cd
mvn clean install -Dtest=skip -DfailIfNoTests=false
cd dhis-web
mvn clean install -Dtest=skip -DfailIfNoTests=false
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?
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 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?
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 …
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 …
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 …
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:-)
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 …
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.
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.
I am currently struggling to build dhis2 correctly I think it reflects my fairly thin grasp on the workings of maven.
Let me retrace my steps:
cd
mvn clean install -Dtest=skip -DfailIfNoTests=false
cd dhis-web
mvn clean install -Dtest=skip -DfailIfNoTests=false
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?
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
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
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
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
You are getting to that age, Bob, where everything was better in the old days