How to generte archetype for Neon relese? - opendaylight

I am trying to generate an archetype so I can update my project to the Neon release. I tried:
mvn archetype:generate -DarchetypeGroupId=org.opendaylight.archetypes -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeRepository=https://nexus.opendaylight.org/content/repositories/public/ -DarchetypeVersion=1.8.0
The instructions on the how to page don't work either. (It is unfortunate that the first step an aspiring developer would take does not work.)
https://docs.opendaylight.org/en/stable-neon/developer-guide/developing-apps-on-the-opendaylight-controller.html
How do I generate an archetype for opendaylight neon. I can't find workable instructions on the ODL website.
Thanks

I ran into the same problem. After some trial and error, I found out that version 1.5.4 of opendaylight-startup-archetype in org.opendaylight.controller atleast creates the right folders.
Unfortunately, building it gives errors in the artifacts, features and karaf .pom files. But maybe this gets You a bit further.

Related

Complete example to use external jar libs in maven-based project

I am working on a project which uses Eclipse UML libraries, which are poorly supported on maven-central. The projects works well using the related jar libs in local. Now, we plan to deploy in using jenkins and docker, so now we want to make the maven build success. When ran locally with IntelliJ IDEA, the app works but when runnin mvn install, the jar libs are (obviously) not taken into account, and the build fails (package missing etc...).
I've investigated the maven-install-plugin for hours now, and I can not find a complete example and/or a MVP, with the syntax to use multiple jars in a libs folder during the maven build.
Can someone provide one or provide pointers to a clear and working example?
A possibly helpful "collection" of solutions, or pointers to solutions, for this kind of problem, including examples and discussion, can be found in this and that stackoverflow threads.
Though one wouldn't call that "clear". But it gives you a bundle of approaches to pick for your specific case.
Edit: Oh, and here, too.

Run Acceleo from Windows command line using Maven

We are using Eclipse Indigo, Acceleo 3.1.3, Maven 3.0.3.
We have a large Acceleo code generation project in Eclipse that we run successfully.
We need to now run that same project via command line from a Maven project so that the code generation step can be run unattended via a job.
Can anyone share the steps on how to configure this keeping in view the versions we have? If anyone has a sample, that'll be great.
We have already tried available information on the web, but the steps there are for different versions and don't work for us.
http://www.obeonetwork.com/page/building-an-acceleo-generator,
http://www.obeonetwork.com/page/integrating-acceleo-in-an,
and other sites.
Thanks for your help.

What is Tycho in Eclipse and do I have to learn to love it?

I have been trying to install an Apache project (PDFBox) using
mvn install
and this then caused some plugins (Tycho) to be installed in my Eclipse apparently automatically, after which my Eclipse stopped working and I had to delete everything and re-install Eclipse.
I have done a moderate amount of Maven work but have never seen Tycho and have not yet learnt to love it. I can't see how to install PDFBox without Tycho but I don't trust things I don't understand. Is it essential? and if so how do I get it to install without breaking all my other Eclipse projects?
I think #Bae is the closest to an answer

how to get over these maven/m2eclipse issues

(first, I admit, I have no love for maven/m2eclipse, but it wouldn't be that bad if I could figure out how to overcome these issues)
I am using maven/m2eclipse. m2eclipse is the only good way I know of to suck in the maven jars. Some of these may not have solutions(but I am hoping to be surprised). Maybe solving #9 solves them all?
ISSUES
When I run "mvn clean package", I am dead in the water as far as running a unit test in eclipse while maven is building as I LOVE to multitask but maven prevents me here. How to get around this?
I move eclipse to point to eclipsegen/classes but then the unit tests are still using the classes in target/classes so it's not using my latest code that I just edited in eclipse and debugging is not lining up and it's stepping on blank lines that don't have code.
If I just slightly touch the pom.xml, bam, it builds when I don't really want it to and turning of automatic builds did not seem to help.
On top of #3, I get random pom builds downloading jars which just freezes eclipse from doing anything why the jars are being downloaded(I am a bit multitasker so this frustrates me to no end)
If I want to modify or do something really custom I need, the answer is usually create a java plugin but this then would require me to create another source control project with another automated build making sure the build tags all versions so we can reproduce issues with certain versions. (in ant, I just modify the xml to do custom stuff).
(I hear there is a bug open for 5 years on this one). global exclusions because people on our project keep breaking stuff when they include new things that depend on log4j and sucking that library in breaks us so we want to globally exclude it so people stop breaking the project when adding new things (IVY has global exclusions, why doesn't maven!!!!)
The xml code for generation from an xsd in maven is about 2-3 times the code of doing it in ant. Why is this? That really shouldn't be the case I think.
Running my unit test says xxxx-12.0.8-SNAPSHOT is missing but in my pom.xml it clearly says 12.0.9-SNAPSHOT not .8. ie. m2eclipse gets into some weird state and I get screwed wasting yet more time because someone selected maven
(I don't like IvyDE for the same reasons I don't like m2eclipse). In maven, is there any way like in Ivy to say on a build MOVE ALL jars into target/lib so that I can uninstall m2eclipse(if maven had this one feature, I think all my problems might go away)....That IS AN Ivy feature that rocks by the way!!!!
NOTE: I just realized that uninstalling m2eclipse and running "mvn eclipse:clean eclipse:eclipse" is not really an option since on this project I had to import 30 projects. I think on single projects, that is a great solution.
Is there no way like ant to log the command that was run for debugging purposes? ( in maven how to log the command that was run? )
I should really look into gradle(I hear it's best of maven and ant) as the theory of maven sounded great but you can tell there was a lot of controversy over it(which usually indicates a bad tool). Good tools that really help typically do have some controversy, but not as much as maven has had so it makes me think twice as I don't want to screw the guy who takes over my project(and I know ant will work). Many people I think don't even consider that. They think "I am fine, so why won't the next guy be fine".
Any ideas on how to fix the above issues?
About #9, if you have 2 alternatives :
Execute
mvn dependency:copy-dependencies
See http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html for customization options. You'll have to set your Eclipse classpath manually to point to the newly copied jars.
Use JBoss Tools JDT Extensions to get the "Materialize Library" feature (see http://docs.jboss.org/tools/whatsnew/core/core-news-3.3.0.M4.html). You'll basically just have to right-click on the Maven Classpath library, select a destination folder, select (and rename) the jars you want, and you'll get a m2e-free project in Eclipse (still a valid Maven project in command line though).
You can install JBoss Tools JDT Extensions from http://download.jboss.org/jbosstools/updates/development/indigo/
Disclaimer: I like Maven and M2Eclipse, and I have not experienced any of the issues that you mention. In general, M2Eclipse does not get in the way much for the way I'm working.
One thing that might help is disabling the Maven Builder for the projects (right-click the project, select "Properties", then "Builders"). This will get rid of many of the issues you're complaining about.
One other thing that might help you (and comes close to #9 on your list: Uninstall M2Eclipse and use mvn eclipse:eclipse, which will generate Eclipse .project and .classpath files, which include all dependencies as Eclipse project dependencies. Whenever you add or change dependencies, you will have to run mvn eclipse:eclipse again. Give this a try...
Although it does sound like a faster PC would solve some of your issues I do agree that the m2eclipse plugin sucks (although it sucks a little less since eclipse indigo). Because of this I switched to using Intellij for a while but I switched back to eclipse after a month (for me, eclipse is still the best in spite of m2eclipse).
I use m2eclipse to be able to work in eclipse but nothing more. All my maven builds (package, install, whatever) I run with maven itself (command line) simply because there have been too many occasions where the result was different (working in one, not in the other and and maven was always correct).
So, sorry, no direct answers to your questions, just some tips:
1) do it outside eclipse
2) stick to maven standards (target/classes); that will make your life a lot easier
6) using dependency management in a parent pom might help a bit
8) if you get the same issue when running from command line then there is a problem in your pom (resolve using mvn dependency:tree), if not, see 1
9) maybe assembly is an option here but I would not recommend your approach

STS M2E 'Plugin execution not covered by lifecycle configuration" Error - Flex-Mojos

I am trying to write my pom.xml for a multimodal flex application. I have been using this resource as an example:
http://www.sonatype.com/books/mvnref-book/reference/flex-dev-sect-creating-with-archetype.html
I am using M2E v1.01 but I am faced with a number of 'Plugin execution not covered by lifecycle configuration" errors. As far as I can see - there are no m2E connectors available to resolve this and I have tried all the Maven advice I can find - to include:
Clean
Update dependencies
Update project configuration
The problem only occurs if the project is declared as swc or swf package. My next move to ask Eclipse to 'permanently mark goal as ignored' - which seems a little brash.
Any advice would be appreciated.
Thanks in advance.
With STS 2.8.0, we have upgraded m2eclipse to be version 1.0. However, this can cause a bit of trouble with existing projects. I wrote a blog on this a couple of months ago.
http://blog.springsource.org/2011/10/18/upgrading-maven-integration-for-springsource-tool-suite-2-8-0/
Essentially, the new architecture for m2eclipse requires that each maven plugin you use must be mapped to one Eclipse plugin to handle the plugin's execution inside of Eclipse. This obviously causes problems since not every maven plugin author has the knowledge or time to create also create and maintain an Eclipse plugin.
By marking the plugin as ignored, you are saying that the plugin should never be executed inside of Eclipse (implying that whenever you need it to be executed, you will do so from the command line). Once marked as ignored, you can then change it to execute, which means that it should always be executed whenever the associated lifecycle is performed in Eclipse. This may cause performance problems, and so only do it if you know the risks.
If all this is too much for you, then STS provides a downgrade option to revert to an older version of m2eclipse. Go to the Dashboard extensions page. Unfortunately, you will have to manually revert all changes to your .project and .classpath files (we provide an auto-upgrade mechanism, but not a downgrade mechanism...presumably everything is in version control).
Any questions or problems should be sent to the STS forums:
http://forum.springsource.org/forumdisplay.php?32-SpringSource-Tool-Suite
You can check this alpha connector "Flex Maven Integration for Flash Builder" on the eclipse marketplace: http://marketplace.eclipse.org/node/648556.

Resources