Instructions to build from source code

Hi,

I am trying to understand the behaviour of the API for a particullar call.
That call generates a big SQL query which is particulary slow.
I have added some logging traces to the code but I’m stuck trying to compile this modified version.

Where can I found some guide to build CMDBuild from the source code?

Thanks!

1 Like

Hi Adrian,

I’m also trying to set up the application in my local environment. I also couldn’t find any steps for the same. Did you find any such references. Please share if you have any references.

Thanks in advances

Regards
Jose

Hi Jose,

I have some dirty instructions taken while trying to compile.
They are not complete. I didn’t have the time to finish.

Please, let me know if you are able to generate the .war

EDIT: it is not allowed to add links to the forum. I have added the instructions with the correct links to gist dot github dot com SLASH adrianlzt/a76f33442c875bfc9017956f3c24e799

Download code from sourceforge (.tar.gz)

Deps needed:
bitbucket dot org SLASH tecnoteca/cmdbuild-dependencies/downloads/
Uncompress and install:
bash install-artifacts.sh

Copy those deps to our m2 local cache:
rsync -a . $HOME/.m2/repository/

Compile shark-ws-plain and copy to the dir where cmdb looks for it:
cd $HOME/.m2/repository/net/sourceforge/sharkwf/shark-ws-plain
mvn package
cp target/shark-ws-plain-4.4-1.war 4.4-1/shark-ws-plain-4.4-1.war

cp $HOME/Documentos/cmdbuild/cmdbuild-3.2.1/shark/extensions/target/cmdbuild-shark-extensions-3.2-DEV-SNAPSHOT.jar $HOME/.m2/repository/org/cmdbuild/cmdbuild-shark-extensions/3.2-DEV-SNAPSHOT/cmdbuild-shark-extensions-3.2-DEV-SNAPSHOT.jar

mkdir -p $HOME/.m2/repository/org/cmdbuild/cmdbuild-utils-lang/3.2-DEV-SNAPSHOT/
cp …/cmdbuild-3.2.1/utils/lang/target/cmdbuild-utils-lang-3.2-DEV-SNAPSHOT.jar $HOME/.m2/repository/org/cmdbuild/cmdbuild-utils-lang/3.2-DEV-SNAPSHOT/cmdbuild-utils-lang-3.2-DEV-SNAPSHOT.jar

mkdir -p $HOME/.m2/repository/org/cmdbuild/cmdbuild-utils-io/3.2-DEV-SNAPSHOT/ $HOME/.m2/repository/org/cmdbuild/cmdbuild-client-rest/3.2-DEV-SNAPSHOT/ $HOME/.m2/repository/org/cmdbuild/cmdbuild-utils-postgres/3.2-DEV-SNAPSHOT $HOME/.m2/repository/org/cmdbuild/cmdbuild-core-configdefs/3.2-DEV-SNAPSHOT
cp utils/io/target/cmdbuild-utils-io-3.2-DEV-SNAPSHOT.jar $HOME/.m2/repository/org/cmdbuild/cmdbuild-utils-io/3.2-DEV-SNAPSHOT/; cp client/rest/target/cmdbuild-client-rest-3.2-DEV-SNAPSHOT.jar $HOME/.m2/repository/org/cmdbuild/cmdbuild-client-rest/3.2-DEV-SNAPSHOT/; cp utils/postgres/target/cmdbuild-utils-postgres-3.2-DEV-SNAPSHOT.jar $HOME/.m2/repository/org/cmdbuild/cmdbuild-utils-postgres/3.2-DEV-SNAPSHOT; cp core/configdefs/target/cmdbuild-core-configdefs-3.2-DEV-SNAPSHOT.jar $HOME/.m2/repository/org/cmdbuild/cmdbuild-core-configdefs/3.2-DEV-SNAPSHOT/

vi pom.xml
remove utils/bugreportcollector and utils/alfresco-migrator

install “sencha-cmd” (we need the “sencha” binary)
cdn.sencha DOT com SLASH cmd/6.2.2/no-jre/SenchaCmd-6.2.2-linux-amd64.sh.zip

Put sencha in the PATH
export PATH=$HOME/Documentos/Sencha/Cmd/6.2.2.36/:$PATH

mvn clean install

cmdbuild-test-core fail:
Tests in error:
GeoAttributeIT.createDeleteGeoAttribute@org.cmdbuild.test.core.getEmptyDb » Runtime
GeoAttributeIT.createGeoAttribute@org.cmdbuild.test.core.getEmptyDb » Runtime …
GeoStyleRulesIT.testGeoStyleRules@org.cmdbuild.test.core.getEmptyDb » Runtime …
GeoStyleRulesIT.testGeoStyleRulesParamsCreateUpdate@org.cmdbuild.test.core.getEmptyDb » Runtime
GeoStyleRulesIT.testGeoStyleRulesWithFunction@org.cmdbuild.test.core.getEmptyDb » Runtime
GisValueIT.testGisValueWithNavTree:86->createGeoAttribute:165 » UncategorizedSQL

Ingore and skip the rest of tests:
mvn install -rf :cmdbuild-main

To build just one module:
mvn package -pl :cmdbuild-services-rest-v3

To add that module, uncompress the oficial .war, add our module and regenerate .war file

Jose, were you able to compile cmdbuild successfully?