I have a project with a complicated ant build that we would like to remain as ant at the moment (will be converted to maven eventually).
I am using jenkins at the moment to build/test our application. After build/test, I now want to push the built artefact to a Nexus repository.
For a Maven project, I can use the post build action "Deploy Artefacts to Maven Repository" to do this.
Whats the best way to structure my Jenkins jobs to achieve an ant build and then deploy the code to Nexus?
Have you seen the example Ant scripts in the Sonatype website?
They actually include pushing artefacts to Nexus:
http://central.sonatype.org/pages/apache-ant.html#signing-and-deployments-using-the-maven-ant-tasks
Or there is also some more docs at Sonatype:
http://books.sonatype.com/nexus-book/reference/staging-deployment.html#staging-ant
Related
I have teamcity currently configured to use the maven mojo, to publish the gradle jar as a nexus snapshot with just the gav.
I observe that if i use the maven plugin and do a gradle install in the IDE, i am able to see the generated pom.
1) Can i use this pom to publish the jar in nexus repo in teamcity ? I know that i can do it for a pure maven build by using it's pom.
2) Is there a way to not use this pom, and istead configure teamcity build steps to publish from gradle build directly ?
Gradle can of course take care of the publication. It will leverage the build information to produce a POM file that represents best what is declared in your project.
It will then be trivial to invoke that Gradle task from the Teamcity build.
Have a look at the publishing documentation for details on how to set it up.
Suppos that repo and share module were generated from maven alfresco archetype as described here. And now it needed to install one of alvex addons. It is clear that jars/amp can be build from sources, but what to do with this? Where to put they in generated maven project to get them installed in alfresco when mvn integration-test -Pamp-to-war is executed?
That tutorial assumes two separate maven projects created using the repo archetype and the share archetype, respectively.
If you want to be able to run integration tests with multiple AMPs you may rather use the all-in-one archetype instead.
See How to use external AMP in alfresco Maven Project
Is there a maven plugin available which calls gradle?
It might sound strange, but my company still uses maven and I want to make some experiments with gradle on our jenkins server. :-)
I'm struggling to understand the complexities of deploying a multi-module maven site that has working links. This is complicated by the fact that I'm deploying to Google Code using the maven-scm-provider-hg.
According to the docs, I'm supposed to run mvn site:site site:stage to get a full working site. However when I run mvn site:deploy it deploys the parent pom site which is empty except for the images and css folders.
Next I try mvn site:stage-deploy. This fails because it adds staging/ to the url, which since I'm using Google code causes an error because http://code.google.com/p/myproject.site/staging isn't a repository. This also isn't a long term solution since I'm pretty sure the maven release plugin runs site:site.
What is the official way to deploy a full multi-module site with working links?
In order to run the site build of a multi module build with everything ready you have to run the site lifecycle phase site-deploy and not just the site plugin goal.
So I would run
mvn clean install site-deploy
or for deploy of artifacts and site
mvn clean deploy site-deploy
And of course you have to have the setup correct in terms of distribution management. Besides that you want to ensure that all modules have the same directory name as their artifactId and you have set up site.xml with the respective links and so on as documented on the site plugin website.
Depending on the site deployment protocol you might also have to add a build extension (e.g. if you use dav)
It certainly takes a bit of fiddling but it works. Also I would recommend to use the latest version of the site plugin (3.1) and Maven (3.0.4).
I am having a java project with a ant build file, using this ant file i create an ejb of the project and deploy it on the jboss server.
Now I am planning to use maven and convert this existing project which consist of nearly 28-30 jar's in its class path(jars related to ejb3, hibernate, jboss, etc).
I can easily do it using eclipse i.e right click project goto maven and click Conver to Maven.
A pom.xml is generated and the MavenClassPath Container is also added to the project.
Now I want to know how to get rid of those 28-30 jar's present in the lib folder of the project and in the classpath. i.e. I want my pom.xml handle all the dependencies.
Does Maven provide any mechanism to achieve this goal while converting the project or I have to add all of these jar dependencies one by one manually in the pom.xml file.
The intention of doing this is I want to have common maven remote repository where the jars will be stored and each developer machine will point to it through their maven project.
Thanks
I think you're after a repository manager like Nexus (I use Nexus, it seems to be the most popular http://nexus.sonatype.org/ ).
Nexus can be used as:
A proxy repository (for Maven Central, etc)
A repository for your own releases.
Nexus provides user management for your developers to release builds into the repo.
Developers will then point their Maven settings.xml file to your Nexus repository, and all their dependencies will come from here (Nexus will cache them).
I'm afraid you will have to configure the dependencies individually, but that is a good thing, because you should pay attention to what version ranges you are interested in for each dependency.
Any jars which can't be found in Maven Central, etc, you can add to your own Nexus repository .
Ofcourse there are alternatives to Nexus, but I haven't used any.
HTH
The most important thing i can recommend is to use a Maven Repository Manager (Nexus, Artifactory or Achiva or other..).
Second your pom conversion via Eclipse shows me that you are not using an up-to-date Eclipse nor an up-to-date Maven Plugin for Eclipse. The best thing would be use Eclipse-Indigo (m2e is the newest and greatest).
Furthermore you have to go through all your jar's and add them step by step to you pom (dependencies) and see if your project can be compiled. This should be checked on command line not inside Eclipse.
After you got a working pom.xml file put it into your version control and check if you can remove some of your added dependencies based on transitive dependencies. After that you can finally delete your lib folder.