I am using some plugins which depend on snapshot versions of other plugins.
As I understand, Ivy tries to fetch the newest version of these plugins every time you start grails. If Ivy does not succeed, grails will not start :-(
As I like to develop offline, I am now looking for a way which lets me avoid this behaviour...
You could pull them down and store them on your machine using a local repository and comment out any remote repositories. Here is some documentation. Scroll down to "local resolvers"
Related
Good afternoon,
As I understand Jenkins, if I need to install a plugin, it goes to Jenkins Plugins
The problem I have is Jenkins is installed on a closed network, it cannot access the internet. Is there a way I can download all of the plugins, place them on a web server on my local LAN, and have Jenkins reach out and download plugins as necessary? I could download everything and install one plugin at a time, but that seems a little tedious.
You could follow some or all of the instructions for setting up an artifactory mirror for the plugin repo.
It will need to be a http/https server and you will find that many plugins have a multitude of dependencies
The closed network problem:
You can take a cue from the Jenkins Docker install-plugins.sh approach ...
This script takes as input a list of plugins, and optionally versions (eg: $0 workflow-aggregator:2.6 pipeline-maven:3.6.5 job-dsl:1.70) and will download all the plugins and dependencies into a working directory.
Our approach is to create a file (under version control) and redirect that to the command line input (ie: install-plugins.sh $(< plugins.lst).
You can download from where you do have internet access and then place on your network, manually copying them to your ${JENKINS_HOME}/plugins directory and restart the instance.
The tedious list problem:
If you only specify top-level plugins (ie: what you need), every time you run the script, it will resolve the latest dependencies. Makes for a short list, but random dependencies if they get updated at https://updates.jenkins.io. You can use a two-step approach to address this. Use the short-list to download the required plugins and dependencies. Store the generated explicit list for future reference or repeatability.
I'm using maven 3.1.1 and am working on a big Java project in which we have a large number of dependencies on different components of the Spring Framework. Whenever I build via mvn clean install the build takes forever. I've looked at the terminal, and essentially the build takes long because maven is trying to download metadata from a source from which it can't establish a connection:
It basically blocks here:
Downloading: http://source.mysema.com/maven2/releases/org/springframework/spring-beans/maven-metadata.xml
After a while, I'll get a connection refused before the client can even proceed any further. I have no such direct dependency from source.mysema.com so I'm not exactly sure why maven would even attempt to download from here.
A few questions:
1) How does metadata actaully work? When does maven actually attempt to pull this information? Does metadata exist for every dependency, or is this repository-specific?
2) Is there a way to force a timeout on the client to not pull this metadata if it can't establish a connection after let's say, 2 seconds?
3) I've looked into our own internal repository in which this project depends via the <repository> tag. In trying to debug this issue, I've looked directly at our Nexus repository and saw that the metadata.xml file contains a huge list of versions for this specific Spring dependency. Why should my build always download ALL the versions for this dependency?
My suspicion was that my repository definitions in my pom.xml was causing maven to download from that source.mysema.com transitively (via some remote repository I've definied). So I commented out all my repository definitions in hopes that maven wouldn't talk to any remote repositories and instead pull out dependencies from my local m2, but somehow it keeps trying to download from source.mysema.com.
Thoughts? Thank you.
Answering your questions
1) How does metadata actaully work? When does maven actually attempt to pull this information? Does metadata exist for every dependency, or is this repository-specific?
Answer : maven-metadata is downloaded since you have specified Release into one of your version tags for eg
<spring.version>3.2.4.RELEASE</spring.version>
So now with daily build, you will see the metadata being downloaded as maven checks for latest build versions for this release. You will be seeing something like this in your screen
Downloading: http://nexus.mynexuslocation/nexus/content/repositories/public/org/springframework/spring-tx/maven-metadata.xml
Downloading: http://central.maven.org/maven2/org/springframework/spring-tx/maven-metadata.xml
Also check the updatePolicy in your pom.xml if it is has been set to daily
2) Is there a way to force a timeout on the client to not pull this metadata if it can't establish a connection after let's say, 2 seconds?
Answer : Not sure of this one.
3) I've looked into our own internal repository in which this project depends via the tag. In trying to debug this issue, I've looked directly at our Nexus repository and saw that the metadata.xml file contains a huge list of versions for this specific Spring dependency. Why should my build always download ALL the versions for this dependency?
Answer : You have to move nexus repository up in the hierarchy. Maven will look at nexus first and only when not able to find it, will go outside nexus.
I've set up Jenkins as a service on my Windows 7 developer PC in order to provide rational arguments to why we should use Jenkins and not Bamboo in the company.
I've installed the 'Analysis Collector Plugin': https://wiki.jenkins-ci.org/display/JENKINS/Analysis+Collector+Plugin, but Jenkins ignores my configuration of the trend graph:
After I save the config, it still displays the default graph with the default settings:
I know the graph settings are stored as cookies, which is why I use the URL http://127.0.0.1:8080 instead of http://localhost:8080, but still I can't get it to display the right graph.
Jenkins v1.538
Static Analysis Collector Plug-in v1.38
This issue has since been resolved in later versions of the Static Analysis Plugin. Please download and install the latest version 1.51 and upon restart the issue should be resolved.
There is an interdependency of this plugin with the Static Code Analysis Plugin, so you will need to update that plugin to the latest version as well.
Lastly, and most importantly, you will need to (and should anyway) update Jenkins from version 1.538 to a more recent version to remain compatible with the newest version of the Analysis Collector Plugin. For this reason (as well as many others), I highly reccomend the latest version of Jenkins as well, which at the time of writing this is 2.63.
This has been very upsetting for me up till now. Here is what I am trying to do:
IDE I'm using is Intellij IDEA.
Building a grails application.
Grails application specifies two dependencies on in house grails plugins also being developed in IntelliJ as separate grails plugin projects.
Now to make any changes to plugins, I update the source code in plugin projects and use mavan-install (Maven Publisher plugin) to deploy to local Maven repository.
I have to uninstall the plugin in core grails project. Delete the plugin cache from ivy and then run the core grails project which gets the latest copy of plugin from local maven repository.
What's the effective and ideal way to achieve this? A single change makes me do some 5 minutes of labour work to even test and run core application.
Any recommendations/ best practices?
Use inline plugins for this - see section "Specifying Plugin Locations" in http://grails.org/doc/latest/guide/12.%20Plug-ins.html#12.1%20Creating%20and%20Installing%20Plug-ins
By specifying the plugin project directory with grails.plugin.location.<plugin-name> as the location of the installed plugin, you can edit the real files and the changes will affect the test application, and there's no need to sync anything up.
Good day,
I'm trying to integrate our company's Grails plugins into our Maven repositories (our repositories are named 'snapshots' and 'releases').
To do that, I installed the maven-publisher plugin in all of our plugins, and I'm deploying them using the "grails maven-deploy" command. This works well.
However, if I deploy a SNAPSHOT version of a plugin (say, version 1.0.0-SNAPSHOT), it gets properly deployed in our repository, but I can't install it in our applications (using version "latest.integration").
I'm using Grails 1.3.7.
First of all, when deployed, the actual artifact name has a timestamp added to it ("blablabla-1.0.0-20110421.122823-1.zip"). However, the version is still 1.0.0-SNAPSHOT. I'm guessing that it's Maven that does that transformation.
However, Ivy doesn't seem to understand the transformation, or to handle SNAPSHOT versions. I get errors like:
==== http://myRepo/repository/snapshots: tried
-- artifact myOrg#blablabla;latest.integration!blablabla.zip:
http://myRepo/repository/snapshots/myOrg/blablabla/[revision]/blablabla-[revision].zip
Initial research has revealed that I could create a resolver pattern, but that seems a little bit complicated for something that should work out of the box, and my initial tests were not conclusive anyway (I tried a few patterns, none of which worked).
I should note that deploying my plugins locally using the "maven-install" command works, because the script create an artifact with the proper version (blablabla-1.0.0-SNAPSHOT.zip) alongside the one with timestamps.
Does anybody have a solution?
Thanks!
Guillaume.
I resolved this modifying Artifactory snapshot repository configuration:
<snapshotVersionBehavior>non-unique</snapshotVersionBehavior>
Now when you have foo-plugin-1.0-SNAPSHOT.zip and you upload it the name stays same.