How to know which projects use a maven dependency in JFrog Artifactory? - maven

In my organization there are multiple projects (usually services) that are not necessarily uploaded to our maven Artifactory, while there are projects (usually organization libraries) that are uploaded to Artifactory.
The service project may depend on the library project and pull their artifacts from our maven repository.
I'm interested to know if there is a way to list which projects in my organization pull a given dependency on Artifactory, in other words - which projects use a certain library in my organization.

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

TFS as a local Maven repository

I need to use TFS (now Azure DevOps) as the local repository manager for Maven artifacts in a corporate network where there is no access to internet.
Currently we use Nexus where we get the artifacts downloaded externally and then get into the network and upload them to Nexus manually. We want to get rid of Nexus and use TFS as the repository manager. The problem is I don't find an option in TFS to upload the artifacts. See the pic
Maven Packages screen.
I just followed this and got the jar of my project published but what I want is to upload all the jars present in .m2/repository to TFS. Please help me with any documentation.
Glad to see you're evaluating Azure Artifacts.
We don't have a good "bulk import" guide for Maven, so I can't point you to links right off the bat. #Shayki Abramczyk has a good suggestion in the comments above of scripting mvn deploy to go through all of the pom.xml files in your repository folder.

copying packages from different projects to another project using maven

i have different maven projects, i planning to create one more maven project in that i want to copy some packages from above projects. Can I do copy the packages from other projects to another project using maven ?

Build Process Design: Nuget vs Artifact Dependencies

I have an application A that depends on an internal shared library B. A and B each has their own repositories.
I'm using TeamCity 10 to build these two projects. Two ways I considering doing this:
Build B and publish the dlls as artifacts. Build A with an artifact dependency on B.
Build B and publish as a nuget package. Build A with a nuget dependency on B.
My questions are:
Which approach is better?
Artifact dependencies seem like the simplest approach and can get the job done, but if we go the nuget route, we can generalize dependency resolution and decouple it from the buildserver to do it. Another advantage I can see with nugets is that when developers checkout solution for B, any dependencies can be resolved through nuget. While for artifact dependencies, some type of pre-build script on the developer's local machine is needed to retrieve/copy dll artifacts, mimicking what TeamCity does with artifact dependencies on the buildserver (is there a better approach for this?).
If we implement nuget dependencies, why would we ever need artifact dependencies at all?
Thanks in advance for any feedback offered.
The best approach for this is based on your projects developing progress.
If the project A and Project B are still in developing, I suggest you use artifact dependencies. Since you will change the projects very often when developing them, in TeamCity you just need to add artifact dependencies to the build configurations. No matter how you change the projects code, the build configurations need not to change.
If the projects development has finished, the NuGet dependencies is a good choice. Because if you are using NuGet dependencies when developing the projects, when any code changed during developing, you need to re-pack the packages and reinstall it into your project.
I would prefer to use Nuget just as the advantages you have already mentioned in your question. It's more convenient and can save more time when you want add the shared library to your project/solution to build locally.

Resources