Jenkins Artifactory Plugin multi-project release - maven

I have configured jenkins and the artifactory plugin to work and do the release for single project.
I recently created a multi-project, and im not sure how to release so that all dependant projects have the version incremented.
So for instance Project A -> Project B - > Project C
If i release project C from jenkins will this cause an increment in versions for all projects, i really cant be messing around with releases... so have not tested this.
Thanks

maven multi module project.
If the projects are not multi module than i will need update each one individually.

Related

Is it possible to change dependencies in a maven plugin programmatically?

I am building a maven plugin which I would like to attach to a project which uses the artifact of another project which I'm building.
For instance:
Project A --> Project B
I could run Project A with two different branches of Project B so I would like to checkout and generate the artifact on demand.
Is it possible to access the maven dependencies of the project and remove or add one or trigger another project build?

Best practice to add a maven dependency to an Eclipse RCP Plugin

I want to add some GitHub projects as dependencies to my Eclipse RCP Plugin. The GitHub projects are oshi and leshan.
Both GitHub projects provide maven builds over maven central which i could use.
But as i understand so far i cant use these builds directly in an Eclipse RCP Plugin because it requires OSGI-Bundles - in contrast to an "classic" Eclipse Java project.
So far i found three ways of dealing with this problem:
let Eclipse convert the JARs to an OSGI-Bundle and add them to a Plugin which i can make a dependency on (described here https://stackoverflow.com/a/3594698/12029492)
look if the GitHub projects are available on Eclipse Orbit and add the p2 Repository to my Target Platform. (described here https://stackoverflow.com/a/56854979/12029492) Sadly on the Orbit site is only the oshi project in an older version than it is on GitHub.
create my own p2 repository with p2-maven-plugin and add it to my Target Platform.
I also looked into Tycho but as far as i understand you can only add a p2 repository as a dependency in Tycho, which leads again to the problem of creating one.
Is there another/better way of dealing with Non-OSGI-Bundle Maven builds in an Eclipse RCP Plugin?
EDIT: i found for me the best way to use gradle (a gradle plugin bnd-platform), to automatically resolve the dependencies using maven central and create a local p2 repository, described in Option 1 here https://stackoverflow.com/a/29509794/12029492
Recently the Eclipse Maven (M2E) implemented tight integration of Java libraries from Maven central into the target platform. With this, you can easily add Java libraries to your target platform and they can be converted (if necessary) on the fly to OSGi bundles including their dependencies.
See https://www.vogella.com/tutorials/EclipseJarToPlugin/article.html for how to using Java libraries (from Maven Central) for OSGi, Eclipse Plug-in and Eclipse RCP development.
This extension is also supported with the latest Maven Tycho version for command line builds, see https://www.vogella.com/tutorials/EclipseTycho/article.html

Mavenizing Mule project from gradle

I am trying to move my Mule ESB project from gradle to maven due to test case issues. I understand I need to remove the .gradle file from the project and when I click on mavenize , nothing happens in Anypoint studio. Any suggestions ?
To mavenize your project you may use Eclipse because this IDE is best suitable with Maven. You'll need to download eclipse, and then add mule support in it. Follow this tutorial to do the same. After that import your project in eclipse and mavenize it. You make take help from this example by David Dossot, to configure a mule project with maven.
If you have AnyPoint Studio, you can create a Mule application and it will already be set up for use with Maven. I would then bring my application artifacts into the newly created project. This way you start with a fresh project that's set up correctly for Maven. Also, you will learn more about things by bring in your mule config, app properties, deploy properties, java classes, and tests into a correctly formatted project structure. You will leave any Gradle artifacts behind. I don't know what button you are clicking called "Mavenize" but Anypoint Studio will allow you to create a shell project that works with Maven. Just create a Mule Application project and copy/paste in the pieces from your existing application. Don't use Eclipse to set up a Maven Mule application project. That's backing up and not utilizing what's available to you.

How to configure two STS gradle projects in eclipse to use another STS gradle project?

I have a two spring boot applications. Each application is setup as a separate eclipse project. Let's call them project A and project B. I also have another project C that contains domain classes. Project A and B need to use project C. All projects are in the same eclipse (Mars.1 Release 4.5.1) workspace.
Per this post and this link, I have
Created a pom.xml at the root of project C and typed mvn install
I have checked "Remap Jars to maven projects", "Remap Jars to Gradle Projects", and "Use Custom Tooling Model" under Window -> Preferences -> Gradle
From the context menu for each project, clicked Gradle -> Enable Dependency Management.
From the context menu for each project, clicked Gradle -> Refresh Dependencies.
After making changes to a domain class in project C and clean and build project C, I clean, build and bootRun project A or B and notice that the changes in project C are not present.
How can I properly configure remapping of jars to gradle projects so that changes in project C are reflected in A and B without having to reinstall to the local maven repo?
I'm using SpringSource Tool Suite Gradle Integration 3.7.2.

m2e will not run on server [duplicate]

I'm trying out the next version of Eclipse using the latest milestone build and I'm having an issue getting my Maven project deployed to Tomcat.
Previously in Eclipse 3.6, my project was automatically enabled as a web project when checked out from SVN. I've checked out my project in 3.7 but get nothing indicating it's runnable as a web project (e.g. trying to run the project doesn't give me the usual "Run on Server" option).
What I've installed is Indigo RC4 "Eclipse IDE for Java EE Developers" version. I then added the latest M2E milestone from here. This enabled me to get up and running, check out my project and I seem to be able to build the project fine (which does create my .war file for remote deployment). Still no "Run On Server" options though.
Does anyone have any clues on what I could be missing? I'm guessing it's a Maven & WTP integration plugin but I haven't spotted the right one yet.
Before m2e became an eclipse project the WTP integration shipped with the core module. Now the core module is an eclipse module and the WTP integration is shipped separately. The current Indigo snapshots of m2eclipse-wtp can be found here. I was unable to get any artifacts from this update site however, even though it's listed in the corresponding JIRA issue.
Fortunately, today m2e-wtp was made available through the m2e Marketplace. Just open the eclipse preferences, go to 'Maven' -> 'Discovery' -> 'Open Catalog' and install it. .
It will work with the lastet version, it's just the .project that is not right.
Simply go into the project properties, make the projet faceted.. tick Dynamic Web Module and you'll get run on server as an option after that.
This will enable the "Run on Server" option, however your problems don't finish there as when you then run it, you'll get a 404.
To fix this, go back into project properties, Deployment assembly.
Delete the WebContent entry (and you can delete the folder in the project later too), and make sure you have the src-main-webapp & src-main-resource folders added.
Bingo.. run the app and it should be fine.

Resources