In Opendaylight, Whenever a change I made, I will build the whole project instead of specific project. mvn clean install -DskipTests=true.. Is there any way to skip the whole build and build the particular pom.xml of project.. E.g In ovsdb, If I want to run southbound project alone what i have to do?
3 Answers
There can be a better way but the workaround I use is :
I use a bash script to copy the jars + config files.
If I make code changes to a module,
- I build the modified module
- Execute the script. to copy the built jar file, config files to the specific folder location inside
System
folder of the unziped ODL distribution. - I restart ODL. bin/karaf clean.
Part of the bash script which I use to update common jars+config
local.sh:
elif [ $1 == common ]; then
cp /home/user/workspaces/workspace-odl/myproject/common/implementation/target/common-impl-2.0.0-SNAPSHOT.jar /home/user/controller/myproject-karaf-2.0.0-SNAPSHOT/system/com/myproject/common-impl/2.0.0-SNAPSHOT/common-impl-2.0.0-SNAPSHOT.jar
cp /home/user/workspaces/workspace-odl/myproject/common/model/target/common-model-2.0.0-SNAPSHOT.jar /home/user/controller/myproject-karaf-2.0.0-SNAPSHOT/system/com/myproject/common-model/2.0.0-SNAPSHOT/common-model-2.0.0-SNAPSHOT.jar
cp /home/user/workspaces/workspace-odl/myproject/common/config/src/main/resources/initial/89-common.xml /home/user/controller/myproject-karaf-2.0.0-SNAPSHOT/system/com/myproject/common-config/2.0.0-SNAPSHOT/common-config-2.0.0-SNAPSHOT-config.xml
rm /home/user/controller/myproject-karaf-2.0.0-SNAPSHOT/etc/opendaylight/karaf/89-common.xml
echo "Updated common"
Execution:
./local.sh common
This will copy the updated jars, and the next time you will run ODL, updated jars will be picked up.
This is fast, and doesn't require me to rebuild whole ODL project.

- 41
- 8
If you are using for first time build the whole project using command
mvn clean install -DskipTests -Dcheckstyle.skip=true
For subsequent changes say you have changed in southbound-impl build southbound-impl using above command.
Next build southbound-karaf using above command. Then you can start the karaf to test. for target/assembly/bin/karaf.[sh|bat]

- 9,662
- 10
- 64
- 112
Assuming you have the appropriate entries in you Maven settings.xml
, you can build any module in an OpenDaylight Maven project by running Maven in its folder; for ovsdb
southbound
:
cd southbound
mvn clean install
Alternatively, from the project's root:
mvn -f southbound clean install
If you only want to build a single module (none of its children):
mvn -pl southbound clean install
(These are all standard Maven options.)
OpenDaylight includes a few nice extras you can use to iterate on builds more quickly:
the
q
profile skips all goals which don't contribute to the resulting artifact (static analysis, tests, documentation...):mvn -f southbound clean install -Pq
updated JARs can be installed directly in a pre-existing Karaf system folder using the
addInstallRepositoryPath
variable:mvn -f southbound clean install -DaddInstallRepositoryPath=.../karaf/system
(replacing
...
with the appropriate path).
These can be combined, so
mvn -f southbound clean install -DaddInstallRepositoryPath=.../karaf/system -Pq
builds and installs the JARs in an existing Karaf (which can even be running — it will re-load the bundles).

- 2,786
- 22
- 32