问题
OpenDaylight Oxygen
Maven 3.3.9
Ubuntu 16.04
karaf 4
~/.m2/settings.xml - cp -n ~/.m2/settings.xml{,.orig} ; wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml
Process used to create skeleton
mvn archetype:generate -DgroupId=org.opendaylight.controller -DartifactId=testing -Dcopyright="None" -DclassPrefix="\${artifactId.substring(0,1).toUpperCase()}\${artifactId.substring(1)}" -DarchetypeGroupId=org.opendaylight.archetypes -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeVersion=1.1.0-SNAPSHOT -DinteractiveMode=false
mvn clean install -Dcheckstyle.skip
I'm trying to build a sample app and deploy it on a separate instance of ODL (karaf 4). I cannot find a working answer to this anywhere.
I've tried copying the contents of PROJECT/karaf/target/assembly/system/org/opendaylight/controller to the equivalent folder on the other ODL instance. Then used feature:add-repo to add the feature. It was able to detect the plugin, but feature:install odl-testing failed to install.
Any help would be greatly appreciated.
回答1:
You are not showing what exact failure you hit when you say "feature:install odl-testing failed to install", but FYI most people don't actually use the process you are trying to get working.. it's technically possible to build your new bundles and Karaf feature separately and then manually add it to deploy on a separate instance of ODL... but every project I know of finds it easier to just let the build produce a ready-to-use Karaf distribution.
You have probably seen the distro in karaf/target/assembly which the the ODL archetype (documented here BTW; note the use of archetypeGroupId changed to org.opendaylight.archetypes in the just released latest Fluorine version) produces?
So what you can do instead is to just add your "base" feature which you are presumably wanting to add your feature into as a dependency to your custom feature. With this, you get your ready-to-run custom distribution including your new code and whatever other ODL features you want to include.
来源:https://stackoverflow.com/questions/52116360/opendaylight-oxygen-deploy-app-built-from-opendaylight-startup-archetype