I have 2 Maven projects , a library and an App ,
Both are built and stored as an Artifacts in TFS (2017)
I would like to import project A directly from the TFS Artifacts into Project B
But apparently the structure the TFS artifacts are kept and the fact they do not keep the POM.XML prevents the Project B maven file to indentify the TFS Artifactory as a Maven artifactory and import the Library .
My question is .
1) Is it even possible to use TFS Artifacts the same way Maven artifacts are used ?
2) How does it done?
Thanks in advance
make sure Project A is deployed correctly to your Maven repository (instead or in addition to the deployment to TFS - I would have kept in TFS only the sources...). Then it would be very simple for maven to find project A and add it to B as a dependency.
Hope that helps.
You can try to publish the Artifacts of Project A to a shared folder (Artifact Type: File Share), then reference it directly or add a copy task to copy the artifacts to Project B.
Besides, it sounds like the chain builds in TFS. You can try the extension: Trigger Build Task, the task that can be used to trigger a new Build so that build-chaining is possible. Supports as well conditional triggers. See below similar thread for details:
How to chain builds in TFS 2015?
Using personal library .jar in TFS Online build
Another workaround is upgrading to TFS 2018 or migrating to VSTS to install a Maven artifact is as a dependency of another artifact with the Maven CLI.
Please see Install Maven artifacts using VSTS and TFS for details.
Related documents:
Set up the Maven client in VSTS and TFS
Publish Maven artifacts using VSTS and TFS
Build your Java app with Maven
Related
I'm using Google App Engine for Eclipse and also Git.
First I've created my "helloworld" project with Eclipse and GAE plugin
Then I've created a repository that I've cloned on my Google server machine.
Only problem is my project don't have any pom.xml and I think that's making bug the whole process when I enter $ mvn appengine:run.
Is there a way to create a pom.xml file with mvn CLI? Do you think that's the only problem I have.
Here is my error log:
[ERROR] No plugin found for prefix 'appengine' in the current project
and in the plugin groups [org.apache.maven.plugins, org.codehaus.mo
jo] available from the repositories [local
(/home/Jsmith/.m2/repository), central
(https://repo.maven.apache.org/maven2)] -> [He lp 1]
Help is greatly appreciated.
Eclipse allows to convert a project to maven, try
right click on the project name > Configure > Convert to Maven Project
You can create a Maven project (including the POM) from a template called Archetype in Maven terminology:
In short, Archetype is a Maven project templating toolkit. An archetype is defined as an original pattern or model from which all other things of the same kind are made. The name fits as we are trying to provide a system that provides a consistent means of generating Maven projects.
I'm converting an existing Eclipse-based web project to a Maven-managed one.
Since the project has lots of dependencies, many of which are custom (they're either internally made or they've been taken from sources that have no public repository), is there some 'magic' Maven POM setting that will let me load every jar from WebContent/WEB-INF/lib and make the project work as before right now, so that I can configure each dependency and do the necessary refactoring to turn it to a proper Maven project with a little more time and care?
I have already seen this question, but the project must continue to compile inside Eclipse, so - or at least I guess - it is not just a matter of using the Maven war plugin
What you want to do is called "installing" your non-mavenized JARs into your maven repository. This can be a local or remote repo that you host.
The command to install to your local repo is something like this: mvn install:install-file -Dfile=My-lib.jar -DgroupId=com.mycompany -DartifactId=My-lib -Dversion=1.2.3 -Dpackaging=jar
You'll want to review the various options for install to suit your project.
Once the non-mavenized dependencies are installed to your repo you can add them to your pom like any other maven dependency. They will be fetched from your local repo.
You will have to set up your own remote repo (like Artifactory) or install each plugin for every developer and CI server in your environment for others on your team to build the project. I strongly reccomend Artifactory, it makes it easy on your and your team to use maven and get dependencies.
I have a Java-based GitHub project, fitnessjiffy-spring (I'm currently focused on the "bootstrap" branch). It depends on a library built from another GitHib project, fitnessjiff-etl. I am trying to configure both of these to be built by Travis CI.
Unfortunately, Travis is not as sophisticated as Jenkins or Hudson in dealing with Maven-based Java projects. Jenkins can easily handle dependencies between projects, but the same concept doesn't seem to exist with Travis. If one project depends on another, then that other project must already be built previously... and its artifact uploaded to some Maven repo where the first project can download it later.
My "fitnessjiffy-etl" library is building and deploying just fine. I'm using Bintray for Maven repository hosting, and you can clearly see my artifacts over plain HTTP at:
http://dl.bintray.com/steve-perkins/maven/
In my "fitnessjiffy-spring" project, I am adding this Maven repo location directly in the pom.xml, so that Travis will be able to find that artifact dependency. Here is the state of my POM at the time of this writing. Note the <repositories> element at the bottom of the file.
When I build this project locally, it works just fine. I can see it downloading the Maven artifact from "http://dl.bintray.com/...". However, when I try to build on Travis CI it fails every time. I can see in the console log that Travis is still trying to download the artifact from Maven Central rather than my specified repo.
Does this make sense to anyone else? Why does Maven utilize a custom repository location in a POM file when building locally, but ignores this configuration when running on a Travis CI build?
From digging into this further, I discovered that Travis uses its own proxy for Maven Central, and has configured Maven to force ALL dependency requests through their proxy. In other words, it does not seem possible at this time to use additional Maven repos specified in the POM file of a project built on Travis.
In my case, I ended up refactoring such that project would not need the outside JAR dependency. I also switched to Drone.io, so I could manage my settings on the build server rather than having to carry a YAML file in my repository (which always struck me as a bit daft).
However, even on Drone it's still a major hassle to manage dependencies between multiple projects (extremely common with Java development). For Java, I just don't think there's currently an adequate substitute for Jenkins or Hudson, maybe running on a cheap Digital Ocean droplet or some other VPS provider instance.
In your install phase add a $HOME/.m2/settings.xml define your custom repository.
cache:
directories:
- "$HOME/.m2"
install:
- curl -o $HOME/.m2/settings.xml
https://raw.githubusercontent.com/trajano/trajano/master/src/site/resources/settings.xml
- mvn dependency:go-offline
script:
- mvn clean install site
I am using Maven as a build tool. Is there a way to deploy the artifacts present in my local maven repository (which I install via a 3rd party tool), to my remote Nexus repository ?
Thanks
If you want to deploy a whole bunch of artifacts with their poms as well as multiple artifacts using classifiers, you could use the tool we created in the Apache Flex project which is part of the Mavenizer tool, that we use to deploy entire repositories or parts of them ...
https://cwiki.apache.org/confluence/display/FLEX/Apache+Flex+SDK+Mavenizer
Code available at: https://git-wip-us.apache.org/repos/asf/flex-utilities.git
The SDKDeployer uses a local maven installation and acts as a wrapper to the maven deploy:deploy-file plugin, the SDKInVMDeployer does the same but without Maven utilizing the Maven libs directly (Is quite a lot faster)
I am working on an ant project and i want to use the jar created by it , in my maven project.
The ant project employs ivy to manage its dependency.
Is there any easy way to do this if possible without changing any code on their side.
It sounds like you want to be able to publish artefacts generated by your ivy-based project to a maven repo so they can be resolved by the mvn-based project.
Try http://draconianoverlord.com/2010/07/18/publishing-to-maven-repos-with-ivy.html
Once the ivy-based project has published its artefacts to the mvn repo, then the mvn-based project should be able to resolve the published artefacts.