How to set order of repositories in Maven settings.xml

As far as I know, the order of the repositories in your pom.xml will also decide the order of the repository access. As for configuring repositories in settings.xml, I’ve read that the order of repositories is interestingly enough the inverse order of how the repositories will be accessed. Here a post where someone explains this … Read more

Correct way to check Java version from BASH script

Perhaps something like: if type -p java; then echo found java executable in PATH _java=java elif [[ -n “$JAVA_HOME” ]] && [[ -x “$JAVA_HOME/bin/java” ]]; then echo found java executable in JAVA_HOME _java=”$JAVA_HOME/bin/java” else echo “no java” fi if [[ “$_java” ]]; then version=$(“$_java” -version 2>&1 | awk -F ‘”‘ ‘/version/ {print $2}’) echo version … Read more

Sort maven dependencies in Eclipse

Finally it is possible with Eclipse Photon now. Just tick the checkbox Sort library entries alphabetically in Package Explorer under Preferences → Java → Appearance See also here under ‘Sort library entries alphabetically in Package Explorer’. Unfortunately theres a bug, at least for me, that the source folders are also reordered, see here.

Gradle Test Dependency

You can expose the test classes via a ‘tests’ configuration and then define a testCompile dependency on that configuration. I have this block for all java projects, which jars all test code: task testJar(type: Jar, dependsOn: testClasses) { baseName = “test-${project.archivesBaseName}” from sourceSets.test.output } configurations { tests } artifacts { tests testJar } Then when … Read more

dependencyManagement and scope

A little late to the party, but I’ll add my two cents. I recently ran into a very difficult to debug issue. I have a parent pom for managing dependencies across multiple projects. I had it set with all the dependencies common amongst them and included groupId, artifactId, version and the most common scope. My … Read more

How can I manage client-side JavaScript dependencies? [closed]

RequireJS does everything you need. My answer to this question may help you. Example: Client app project hierarchy: sampleapp |___ main.js |___ cs.js |___ require.js main.js is where you initialize your client application and configure RequireJS: require.config({ baseUrl: “/sampleapp”, paths: { jquery: “libs/jquery”, // Local underscore: “http://underscorejs.org/underscore-min.js”, // Remote backbone: “https://github.com/documentcloud/backbone/blob/master/backbone-min.js” // Remote on GitHub … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)