Skip to content

Instantly share code, notes, and snippets.

View maciejwalkowiak's full-sized avatar

Maciej Walkowiak maciejwalkowiak

View GitHub Profile
@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>
@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 / gist:7524871
Created November 18, 2013 09:07
Python HTTP server
python -m SimpleHTTPServer
@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/
# shows all maven dependencies
mvn dependency:tree
# updates artifacts local repository
mvn ... -U
# skip tests
mvn .. -Dmaven.test.skip=true
# debug mode
@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>
@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 / SampleWsApplicationSmokeTests.java
Created June 9, 2014 15:22
Spring WS Starter Sample Tests
package sample.ws;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@maciejwalkowiak
maciejwalkowiak / SomeService.java
Created March 9, 2016 22:00
Class dependencies
class SomeService {
private final DependencyA dependencyA;
private final DependencyB dependencyB;
private final Optional<DependencyC> dependencyC;
@Autowired
public SomeService(DependencyA dependencyA,
DependencyB dependencyB,
Optional<DependencyC> dependencyC) {
Assert.notNull(dependencyA);
@maciejwalkowiak
maciejwalkowiak / Analytics.kt
Created June 15, 2017 12:26
mockito-kotlin
interface Analytics<in T> {
fun send(event : T)
}