specify custom location of maven security-settings.xml file? - maven

with maven you can easily specify settings.xml location, e.g:
mvn -s custom/dir/settings.xml package
Is there a similiar way to specify custom security-settings.xml?
The reasoning behind this is simple: to easily distribute it via a local repository. Now, security is NOT a concern - it's all on the intranet.

This was requested as MNG-4853. Although not implemented directly, a workaround is suggested:
I've verified that -Dsettings.security=path/to/security-settings.xml works
As detailed in the announcement blog post, you can also use the master password relocation feature. Write an ~/.m2/security-settings.xml file with a redirection in it:
<settingsSecurity>
<relocation>/Volumes/mySecureUsb/secret/settings-security.xml</relocation>
</settingsSecurity>

Related

SonarQube - Configure Pull Request decoration with parameters

I'm using SonarQube 8.1 (Developer Edition) and Jenkins to analyse Maven projects which source code is hosted on Bitbucket.
I'm using the "Pull Request Decoration" functionality and it's working well. However, to configure this functionality, I had to set these parameters manually (through the GUI, in project page : Administration > General Settings > Pull Request Decoration) :
Configuration name
Project key
Repository SLUG
Is it possible to set these parameters through command line (e.g in mvn command, I'd expect something like mvn clean -Psonar $SONAR_MAVEN_GOAL -Dsonar.pullrequest.decoration.configurationname=<my-conf-name> -Dsonar.pullrequest.decoration.projectkey=<my-project-key> -Dsonar.pullrequest.decoration.repositoryslug=<my-repository-slug>) or throught REST API ?
Get an answer here : https://community.sonarsource.com/t/sonarqube-configure-pull-request-decoration-with-parameters/18999
No, this is not possible to define this from the scanner. Thoses are
project-level parameters, they won’t change from one analysis to the
next one, so better not pollute your scanner with static parameters.
You can indeed define them with the rest API. Have a look at the
api/alm_settings/set_bitbucket_binding entry in your web api
documentation!

How to assume bintray ownership of a repo copied from maven central

Bintray jcenter has copied my maven central artifacts into their repository. I would like to be able to assume ownership, in bintray, of the package, so that I can edit the description and/or hyperlinks and/or other metadata, all of which is currently empty in bintray. However, the form to request ownership does not work, when you try to send, it gives an error stating some field is missing (without stating which field). Any ideas?
You can't link packages if you are a trial user. So this might also be an issue if you want to take ownership. If that is not the case then I would contact Bintray support.
This is now resolved. In the end I needed to create a user on bintray, then create a repository for that user, and then that allowed me to select both of those things for the form requesting ownership.
As a newbie to bintray/jcentral none of this was clear or obvious, nor do they do these things for you, nor do they allow you to request ownership first so that they can inform you of these necessary steps to complete. So it's not particularly user-friendly.

Location of drools-spring.xsd on git hub (or reliable source)

My project depends on drools 5.6.0.Final version. As part of that I'm trying to find a uri that I can rely for the drools-spring.xsd file. I'm trying to locate a reliable URI for that file I can reference, so that eclipses doesn't show issues, and so that spring can also intercept the requests and replace with the files in the jar as it sees fit.
I can drill into drools-spring-5.6.0.Final.jar in eclipse and see the xsd files in org.drools.container.spring. I also can see the xsd file here: http://grepcode.com/file_/repository.jboss.org/nexus/content/repositories/releases/org.drools/drools-spring/5.6.0.Final/org/drools/container/spring/drools-spring.xsd/?v=source
Going to drools.org and following their link to github and follow the rename of their group shown in the README file to https://github.com/kiegroup. I've searched this group for the xsd file(s) but have had no luck. e.g. https://github.com/kiegroup/droolsjbpm-integration/find/5.6.0.Final and https://github.com/kiegroup/drools/find/5.6.0.Final
This makes me think that the xsd files
are generated? Can someone confirm this and if so, is there a reliable URI that I can reference for this?
For some reason, the Drools' team doesn't maintain a hosted version of this schema.
Here you have an old post from Mark Proctor explaining it.
As far as I understand, they policy is still the same: do not host any .xsd file.
Hope it helps,
The drools-spring.xsd file location on drools website will give you a 404 error. You can have below two approaches which i could find while searching on the net.
One : Host the file on your local machine
Two : Place the .xsd file in the same directory as the location of the xml file referencing it.
Please refer to the below information . This will give a better understanding of the two methods mentioned above.

How does one get all the artifacts as a zip using TeamCity Rest API?

The Docs show this
/repository/downloadAll/BUILD_TYPE_ID/BUILD_SPECIFICATION
for getting all of your artifacts as a zip file, but that isn't using the REST API. Is there a way in the REST API do do the same thing? The Docs seem to indicate that the repository links are only there for backwards compatibility.
You can use this URL, it works for me:
http://<TeamcityUrl>/httpAuth/app/rest/builds/id:<BuildId>/artifacts/archived
I use TeamCity 9.
From the documentation: http://confluence.jetbrains.net/display/TW/REST+API+Plugin#RESTAPIPlugin-buildartifacts
Artifacts:
GET <TeamcityUrl>/httpAuth/app/rest/builds/<buildLocator>/artifacts/files/<artifact relative name>
If you download the artifacts from within a TeamCity build, consider using teamcity.auth.userId/teamcity.auth.password system properties as credentials for the download artifacts request: this way TeamCity will have a way to record that one build used artifacts of another and will display that on build's Dependencies tab.
have you tried this?
I'm not sure it's documented, but it works.
http://teamcity-url/downloadArtifacts.html?buildId=216886
If you are using it from .NET you may use the following code:
List<string> downloadedFiles = new RemoteTc()
.Connect(a => a.ToHost("tc").AsGuest())
.DownloadArtifacts(123, #"C:\DownloadedArtifacts");
The above code uses FluentTc library

Property Replacement in Maven Site Content

I'm generating maven site content using the site plugin. I want to have a little table that shows my maven group id, artifact id, parent info, etc on the module. I don't see a plugin for it, so I was going to use the APT format and create a content page with a table for it. The documentation says I can use property replacement in the site descriptor via ${project.name} etc. This fails when i use it in both the descriptor and in my index.apt file. Has anybody seen this done or know how to do it?
The mvn site command generates a Project Summary page which has this information on it. Does that work for you?
For example, when I execute mvn site, get an output here target/site/project-summary.html where the page has a section like so:
Build Information
Field Value
GroupId com.a.b
ArtifactId myapp
Version 1.01.13-SNAPSHOT
Type jar
If you want to create pages which use placeholder like ${project.version} etc. you need to use index.apt.vm (velocity files) wher the replacement works. But for the information you have asked the solution which has been described (project-summary.html) is the right way cause it's automatically generated.

Resources