Ask Your Question

Hacking l2switch code and build deploy

asked 2016-07-26 01:19:31 -0700

sandaruny gravatar image

updated 2016-07-26 01:20:58 -0700

Hi everyone, I'm new to opendaylight and I want to hack odl-l2switch code to add some functionalities. As the user guides and wiki say, I pulled the code from git clone git clone .

Then I coded the necessary changes and used

mvn clean install

to build the code. It was successful. Afterwards when I ran the karaf in the folder,


the odl-l2switch-switch feature was with the snapshots which were not built by me. It was with some other downloaded jars. How can I build my code for l2switch and run it with distribution karaf?

Thanks for taking time

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-07-26 06:19:00 -0700

karthik330 gravatar image

Hi ,

It has to take L2switch's own version if you launch L2switch/distribution/karaf/target/assembly/bin (I believe). Because It refers the same project version for all the L2 features .

Which version are you using and which version is installing?

In which module have you modified? (hostTracker/loopRemover/arphandler etc) . Add some log messages in your modifications and check it out in log file.

edit flag offensive delete publish link more


Hi karthik, I used latest and its showing 4.0 in snapshots. Both the build for the codes and distribution folder shows 4.0. I coded in main-impl and arphandler. And I made some logs in others too. But log does not return any thing. How can I hack the code and test its behavior for odl-l2switch?

sandaruny ( 2016-07-26 07:30:03 -0700 )edit

the log only shows for openflowplugin.impl logs

sandaruny ( 2016-07-26 07:31:17 -0700 )edit

Did you created new class or modified the existing code? If new class,then you have to instantiate it. You mentioned "Both" the build, It means l2switch and ODL-Distribution? Its easy to hack the code, I dont understand your full context.

karthik330 ( 2016-07-27 06:12:00 -0700 )edit

No karthik I hacked the code. But then I thought mvn clean install will replace the l2switch code with the ones that I have modified. But it wasn't. I used the gerrit repo for l2switch. Instead I copied the built jars again to the system directory and then it worked. Any suggestions?

sandaruny ( 2016-07-27 08:04:27 -0700 )edit

i clone from github -> ; when i do mvn clean install it will replace my old code with modified code in .m2 local repository.

karthik330 ( 2016-07-27 08:15:23 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-07-26 01:19:31 -0700

Seen: 36 times

Last updated: Jul 26 '16