Skip to content

Instantly share code, notes, and snippets.

View maciejwalkowiak's full-sized avatar

Maciej Walkowiak maciejwalkowiak

View GitHub Profile
@maciejwalkowiak
maciejwalkowiak / ConditionalOnPropertiesPresent.java
Last active August 29, 2015 14:01
ConditionalOnPropertiesPresent - Spring Boot custom conditional example
package foo;
import org.springframework.context.annotation.Conditional;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Conditional(OnPropertiesPresentCondition.class)
@maciejwalkowiak
maciejwalkowiak / gist:9000062
Last active August 29, 2015 13:56
Maven executable JAR file with dependencies using Assembly plugin. Run with mvn package assembly:single
<build>
<testSourceDirectory>src/main/java</testSourceDirectory>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>full.class.Name</mainClass>
</manifest>
# shows all maven dependencies
mvn dependency:tree
# updates artifacts local repository
mvn ... -U
# skip tests
mvn .. -Dmaven.test.skip=true
# debug mode
@maciejwalkowiak
maciejwalkowiak / .gitignore
Created December 2, 2013 22:53
.gitignore for Mac + Maven + Intellij IDEA
# Intellij IDEA
.idea/
*.iml
*.iws
# Mac
.DS_Store
# Maven
target/
@maciejwalkowiak
maciejwalkowiak / gist:7524871
Created November 18, 2013 09:07
Python HTTP server
python -m SimpleHTTPServer
@maciejwalkowiak
maciejwalkowiak / gist:7356628
Last active December 27, 2015 16:39
jacoco-maven-plugin configuration. mvn verify to make build fail if coverage is too small
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.3.201306030806</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
@maciejwalkowiak
maciejwalkowiak / maven-shade-plugin configuration for Spring Shell
Created October 14, 2013 18:49
maven-shade-plugin configuration for creating execuable single jar Spring Shell based application
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>