Replace openflowj with new / customized version

65 views
Skip to first unread message

Lukas Hubschmid

unread,
Jun 17, 2015, 12:18:31 PM6/17/15
to onos-d...@onosproject.org
Hello everybody,

I would like to use a new / customized version of the openflowj /
onos-loxi library in the onos project.
I have cloned, customized and compiled the onos-loxi project (make, make
all make package-java).
The new .jar-file in the loxi_output/openflowj/target/ folder is named
openflowj-0.4.1.onos-SNAPSHOT.jar
Might be a dumb question, but I am stucked here: how can I replace the
openflowj-0.4.0.onos with the newly compiled .jar file in the onos project?
Btw, I am using IntelliJ IDEA 14.1.3.

Many thanks in advance!

Kind regards,
Lukas

Ali Al-Shabibi

unread,
Jun 17, 2015, 12:33:26 PM6/17/15
to Lukas Hubschmid, onos-d...@onosproject.org
Hi Lukas,

Once you build and install your new jar, it should be present in your m2 repository under .m2/repository/org/projectfloodlight/openflowj/. At this point you will only need to modify ONOS's root pom to use your new bundle.

Edit $ONOS_ROOT/pom.xml find the properties tag and edit the "<openflowj.version>" tag to the version you just created.

Hope this help!

Cheers.

--
Ali
> --
> You received this message because you are subscribed to the Google Groups "ONOS Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to onos-discuss...@onosproject.org.
> To post to this group, send email to onos-d...@onosproject.org.
> Visit this group at http://groups.google.com/a/onosproject.org/group/onos-discuss/.
> To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/onos-discuss/55819DD3.7030901%40pop.agri.ch.

Thomas Vachuska

unread,
Jun 17, 2015, 12:41:01 PM6/17/15
to Lukas Hubschmid, onos-d...@onosproject.org
Hi Lukas,

Your best bet would be to change the /openflow/api/pom.xml file and change the version, (and artifactId and groupId if your library uses different ones). The openflowj library gets "shaded" into the onos-of-api bundle, meaning its content gets repackaged into onos-of-api. The reason we do this is because the original distribution of the openflowj is not an OSGi bundle and we need it to be a bundle. 

You will know that this worked if you do "jar tf target/onos-of-api*.jar", the classes you added will be listed as part of the jar contents.

Thomas

Thomas Vachuska

unread,
Jun 17, 2015, 12:45:19 PM6/17/15
to Lukas Hubschmid, onos-d...@onosproject.org
What Ali suggests is actually an easier way to proceed and accomplishes the same thing assuming you have not changed artifactId or groupId for your library project.

Thomas

Lukas Hubschmid

unread,
Jun 18, 2015, 5:19:01 AM6/18/15
to onos-d...@onosproject.org
Hello Thomas and Ali,

Thank you both very much for your help!
Finally, I did the following two changes:
- set the openflowj.version in onos/pom.xml to 0.4.1.onos
- adapted onos/openflow/api/pom.xml:
        <dependency>
            <!-- FIXME once experimenter gets merged to upstream -->
            <groupId>org.onosproject</groupId>
            <artifactId>openflowj</artifactId>
            <version>${openflowj.version}</version>
            <scope>system</scope>
            <systemPath>/root/onos-loxi/loxi_output/openflowj/target/openflowj-0.4.1.onos-SNAPSHOT.jar</systemPath>
        </dependency>

Now it always uses the most actual openflowj-jar in the loxi_output.
Might not be the best solution but it works for now :)

Thanks again!

Kind regards,
Lukas

Michael Bunimovich

unread,
Jul 7, 2015, 9:53:42 AM7/7/15
to onos-d...@onosproject.org
Hi

I did what Lukas described to hook the customized openflowj to the ONOS project.
But how can I use that openflowj from inside a user application, which is compiled from outside the ONOS project?

I am working on Microwave PoC. I generated a template application and want to make it sending an Experimenter message. I customized openflowj, compiled it and got the necessary classes.
However, the directive
import org.projectfloodlight.openflow.protocol.OFExperimenterPortMod;
fails to find the required class. I tried to use ...ver13 names but that did not help.

I guess I should make the application to use openflowj version 0.4.1. But how?

Thanks
Michael

Marc De Leenheer

unread,
Jul 7, 2015, 9:56:08 AM7/7/15
to Michael Bunimovich, onos-d...@onosproject.org
Hi Michael,

I wrote down the steps needed to develop loxigen extensions.



Hope this helps,

marc

Michael Bunimovich

unread,
Jul 8, 2015, 3:43:45 AM7/8/15
to onos-d...@onosproject.org, mbuni...@gmail.com
Hi, Marc

Thanks for your prompt reply.

Finally, I succeeded to compile my template application with the customized openflowj.
I added the same dependency that was modified in onos/openflow/api/pom.xml file to the application's pom.xml file. To continue Lukas's thread, it would be
        <dependency>
            <!-- FIXME once experimenter gets merged to upstream -->
            <groupId>org.onosproject</groupId>
            <artifactId>openflowj</artifactId>
            <version>${openflowj.version}<
/version>
            <scope>system</scope>
            <systemPath>/root/onos-loxi/
loxi_output/openflowj/target/openflowj-0.4.1.onos-SNAPSHOT.jar</systemPath>
        </dependency>

It worked!

Thanks
Michael
Reply all
Reply to author
Forward
0 new messages