Skip to content

Instantly share code, notes, and snippets.

View xnickmx's full-sized avatar

Nick Martin xnickmx

View GitHub Profile
user = myMavenRepoUserName
password = myMavenRepoPassword
@xnickmx
xnickmx / BuildConfig.groovy
Last active January 3, 2016 22:19
How to store credentials for multiple Maven repos in a properties file.
final properties = new Properties()
properties.load(new FileInputStream(System.getProperty("user.home") + "/.grails/maven.properties"))
final mavenUsername = properties.getProperty("user")
final mavenPassword = properties.getProperty("password")
mavenRepo ("http://repo.mycompany.com:8081/artifactory/libs-release-local") {
auth([
username: mavenUsername,
password: mavenPassword
])
@xnickmx
xnickmx / gist:8375521
Last active January 2, 2016 23:19
Maven settings.xml to workaround Grails Release plugin defect http://jira.grails.org/browse/GPRELEASE-7. Mirrors repositories explicitly instead of mirroring all but our internal repo like https://gist.github.com/xnickmx/8374742. This workaround still has the downside that it doesn't truly mirror all repos -- just the ones that are listed. See t…
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<id>remote-repos</id>
<username>myuser</username>
<password>mypassword</password>
</server>
<server>
@xnickmx
xnickmx / gist:8374742
Last active January 2, 2016 23:09
Original Maven ~/.m2/settings.xml that mirrors all repos, other than my internal repo. See this for context: http://jira.grails.org/browse/GPRELEASE-7?focusedCommentId=79042&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-79042
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>myuser</username>
<password>mypassword</password>
<id>remote-repos</id>
</server>
<server>
@xnickmx
xnickmx / ParamsChecker.groovy
Created June 11, 2013 18:28
ParamsChecker annotation, ASTTransformation and example usage.
package com.faceture.paramschecker
import org.codehaus.groovy.transform.GroovyASTTransformationClass
import java.lang.annotation.ElementType
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy
import java.lang.annotation.Target
@Retention (RetentionPolicy.SOURCE)
@xnickmx
xnickmx / codenarc-maven-plugin-mvn-output.txt
Created June 10, 2013 15:48
Output from "mvn -X" in codenarc-maven-plugin
+ Error stacktraces are turned on.
Apache Maven 2.2.1 (r801777; 2009-08-06 12:16:01-0700)
Java version: 1.7.0_09
Java home: C:\Program Files\Java\jdk1.7.0_09\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"
[DEBUG] Building Maven user-level plugin registry from: 'C:\Users\Owner\.m2\plugin-registry.xml'
[DEBUG] Building Maven global-level plugin registry from: 'C:\Program Files (x86)\apache-maven-2.2.1\conf\plugin-registry.xml'
[INFO] Scanning for projects...
[DEBUG] Searching for parent-POM: org.codehaus.mojo:mojo-parent:pom:30 of project: null:codenarc-maven-plugin:maven-plugin:0.18.1-1-SNAPSHOT in relative path: ../pom.xml