By default, where does Spring Boot expect views to be stored?

The Solution I found the answer via trial-and-error, which turned out rather annoying. I hope someone can correct me if this conclusion is wrong, but it appears that Spring Boot does not like the string WEB-INF. I renamed the WEB-INF directory to view and changed the application.properties to the following and the view loaded successfully. … Read more

Maven not picking JAVA_HOME correctly

It’s a bug in the Eclipse Maven support. Eclipse doesn’t support all of the global Maven properties as per the Maven specs. According to the specs: ${java.home} specifies the path to the current JRE_HOME environment use with relative paths to get for example At least in Eclipse 4.3.1 that is not the case, here java.home … Read more

What’s the difference between these Maven dependency scopes: provided/compile/system/import

Provided means, “This jar should be compiled against locally, but it will be provided on the classpath by something else during runtime, so don’t include it in the classpath for me.” For example, all web containers (eg: tomcat) include the jars for servlets. You should use provided for the servlet classes so you can compile … Read more

Surefire is not picking up Junit 4 tests

mvn -X helped me to reveal the following: … [INFO] [surefire:test {execution: default-test}] [DEBUG] dummy:dummy:jar:1.0 (selected for null) [DEBUG] org.apache.maven.surefire:surefire-booter:jar:2.4.3:runtime (selected for runtime) [DEBUG] org.apache.maven.surefire:surefire-api:jar:2.4.3:runtime (selected for runtime) [DEBUG] Adding to surefire booter test classpath: /home/mindas/.m2/repository/org/apache/maven/surefire/surefire-booter/2.4.3/surefire-booter-2.4.3.jar [DEBUG] Adding to surefire booter test classpath: /home/mindas/.m2/repository/org/apache/maven/surefire/surefire-api/2.4.3/surefire-api-2.4.3.jar [DEBUG] dummy:dummy:jar:1.0 (selected for null) [DEBUG] org.testng:testng:jar:jdk15:5.8:test (selected for test) [DEBUG] … Read more

How do you stop maven from trying to access http://repo.maven.apache.org?

All pom files inherit from the maven super POM http://maven.apache.org/ref/3.0.4/maven-model-builder/super-pom.html which contains this entry: <repositories> <repository> <id>central</id> <name>Central Repository</name> <url>http://repo.maven.apache.org/maven2</url> <layout>default</layout> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> Try setting this in your pom (with <id>central</id>): <repositories> <repository> <id>central</id> <url>http://repo.dev.bloomberg.com/content/groups/public</url> <releases> <enabled>false</enabled> </releases> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <url>http://repo.dev.bloomberg.com/content/groups/public</url> <releases> <enabled>false</enabled> </releases> </pluginRepository> </pluginRepositories>

How to make gradle generate a valid pom.xml file at the root of a project for maven users?

You can use the gradle maven plugin. This adds the pom convention method to your project, which you can use in a task to generate a pom.xml file, like task writeNewPom { doLast { pom { project { groupId ‘org.example’ artifactId ‘test’ version ‘1.0.0’ inceptionYear ‘2008’ licenses { license { name ‘The Apache Software License, … Read more

In a Maven multi-module project, how can I disable a plugin in one child?

By “run the plugin”, I’m assuming you mean that the plugin is bound to a lifecycle phase, and you’d like to unbind it in some modules. First, you could consider changing your POM inheritance so that the modules that don’t need the plugins have one parent and the ones that do have a different parent. … Read more

Gradle not including dependencies in published pom.xml

I was able to work around this by having the script add the dependencies to the pom directly using pom.withXml. //The publication doesn’t know about our dependencies, so we have to manually add them to the pom pom.withXml { def dependenciesNode = asNode().appendNode(‘dependencies’) //Iterate over the compile dependencies (we don’t want the test ones), adding … Read more

tech