Maven enforcer rule to validate plugin configurations - maven-3

Is it architecturally feasible to construct an enforcer rule that will validate the configuration of every plugin in the effective pom?
I get that plugin configurations can't be validated before use, but to not validate them at any time in the build is unacceptable.

Related

How to automate the configuration of LDAP and other plugins for Jenkins using ansible or some other tool

I am working on a project where I need to automate the LDAP and other plugin configuration without manual intervention .Is this possible using Ansible?Or can experts some one suggest a better way to do it.Thank you
The recommended approach for configuring plugins is JCasC. You must inatall the JCasC plugin. LDAP plugin supports JCasC.
Note: JCasC does not manage the installation of plugins themselves, that's a separate topic, just the configuration.

Customize SonarQube rules of sonar-web-frontend plugin in sonar dashboard

I configured sonarQube analyze for my Angular 2 project as this example
sonar-web-frontend-helloworld
And I added sonar plugin to Jenkins and run gulp task as Jenkins command. It was perfectly worked and now I can view my project in sonar dashboard.
But problem is it uses rules from project not from the sonar server. I have added web-front-end plugin in sonar server. I want to use those set of rules while running code analyzer for my project. And also, using current methods to disable some rules I have to disable them from rules file in the project. How can I improve that sonar job for disable rules using sonar dashboard with log in as an admin.
SonarQube analysis will always use the rules from the relevant Quality Profile on the server. If you need to adjust the set of rules applied, then you must edit the profile, most likely the default profile.

How can I publish extra meta-artifacts in ivy transparently for developers?

We have the build system, which builds a lot of components. Built components publish their artifacts by ivy in artifactory.
I want to attach an extra meta-artifact to each component during its publication, but transparently for developers. This meta-artifact will contain the information about build-agent, build-log, changelog, etc.
I have access to build agents, so I can:
change some ivy configuration files on build agents
install a customized ivy with a patch on build agents
modify the ivysettings.xml file
I didn’t find any information in ivy documentation. However, I know that there are methods like “options.getExtraArtifacts()” in the ivy source code, so I guess there is a way.
Waiting for your suggestions.
Thanks in advance!
UPD:
I figured out “options.getExtraArtifacts()” serve an "artifact" subtag in a "publish" tag:
https://ant.apache.org/ivy/history/2.4.0/use/publish.html
Option1 : Artifactory Metadata
Are you using Artifactory Pro? I'm not a user myself but the documentation describes a capability to attach arbitrary XML based metadata to any artifact stored in Artifactory. Standalone REST API that should be simple to call from your build:
https://www.jfrog.com/confluence/display/RTF2X/Attaching+and+Reading+Metadata
The big advantage of this approach is that this data is searchable
Option 2: Jenkins plugin
Again I'm not an Artifactory user, but have always been intrigued by this plugin that reportedly delivers tight integration between Jenkins and Artifactory. The relevent bit is the so called "Build info" that is published by the plugin. I would be surprised if this doesn't include some of the info your looking for.
https://wiki.jenkins-ci.org/display/JENKINS/Artifactory+Plugin
Option 3: Attach a custom metadata file
A typical Maven repository has no support for metadata. Both Artifactory and Nexus have bespoke extensions and it appears that in both products this capability is a paid feature...
If all you want to do is store metadata and don't care about the lack of a search interface, then why not simply attach a file containing your metadata as an additional Module file? The following example documents how to do this:
how to publish 3rdparty artifacts with ivy and nexus
Option 4: Ivy extra attributes
This is only an option if you're storing data in an ivy repository (You are more likely using a Maven repo format).
Ivy has the ability to store custom attributes in the ivy module file.
http://ant.apache.org/ivy/history/latest-milestone/concept.html#extra
The following answer describes how these can also be used to influence the layout of your ivy repository.
Dynamically updating Ivy extra attributes

Retrieve deployment timestamp of Maven artifact programmatically?

does anyone know whether (and how) it is possible to retrieve the deployment timestamp of a Maven artifact from the repository programmatically?
I need to write a plugin that checks the project's dependencies and their dependencies as well. The plugin must check the deployment timestamps of the dependencies and their dependencies to ensure version compatibility during the release process of a very large legacy application with strong coupling between its modules. => Just for the background ;)
So I've tried several Maven APIs (maven-core, maven-artifact, ...) but even the Metadata interfaces don't have something like a timestamp feature.

Jenkins + Tycho: propagating update sites

I'm wondering if there is an easy way to "publish" p2 update sites in Jenkins (built with Tycho) so that they can easily be accessed in downstreams jobs? Currently I'm doing it semi-manually using Jenkins support for copying artifacts between jobs, and then specifying a repository-mirror element in a job-specific settings.xml which refers to the artifacts copied into the job, but this is all a little tricky and requires configuring jobs and build settings in a number of different places.
Is there any nicer way short of using an external solution such as Artifactory?
The only solution involving a repository manager that I am aware of is to use a Nexus and the Unzip Plug-in. (Disclaimer: The Unzip Plug-in is provided by the Tycho project, of which I am a committer.)
With such a setup, you could have one job deploy an update site to Nexus, and the next job use the update site via the unzip URL of the deployed site. Example: If the site was deployed under the GAV project.abc:site:1.0.0-SNAPSHOT, you could then access it via http://<nexus>/content/repositories/<unzip-repo-name>/project/abc/site/1.0.0-SNAPSHOT/site-1.0.0-SNAPSHOT-unzip/.
Note that you are slightly less flexible with such a setup that with what you have set up now: You need to have a version number for what your upstream project is building, so this may become tricky if you have multiple feature branches developing towards the same release version.
If you don't need this, you have the benefit of getting a portable build of your downstream project, i.e. developers build the project in the same way as your Jenkins does.

Resources