Skip to content

Instantly share code, notes, and snippets.

View przodownikR1's full-sized avatar

przodownikR1 przodownikR1

View GitHub Profile
@przodownikR1
przodownikR1 / sonarExample
Created January 3, 2014 11:08
Example sonar config
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pl.java.przodownik</groupId>
<artifactId>exampleSonar</artifactId>
<name>exampleSonar</name>
<packaging>war</packaging>
<version>1.0.0-SNAPSHOT</version>
@przodownikR1
przodownikR1 / gist:8238086
Created January 3, 2014 13:45
sonar console print
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51.914s
[INFO] Finished at: Fri Jan 03 14:37:08 CET 2014
[INFO] Final Memory: 63M/338M
[INFO] ------------------------------------------------------------------------
[INFO] [14:37:08.335] Execute org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test done: 27010 ms
[INFO] [14:37:08.336] Execute maven plugin maven-surefire-plugin done: 27011 ms
[INFO] [14:37:08.337] Initializer JacocoMavenInitializer...
[INFO] [14:37:08.337] Initializer JacocoMavenInitializer done: 0 ms
@przodownikR1
przodownikR1 / java
Created January 3, 2014 14:32
RFC sonar example
public class ClassA
{
private ClassB classB = new ClassB(); // call (constructor of class B) => +1
public void doSomething(){ // method declaration => +1
System.out.println ( "doSomething"); // call (System.out.println) => +1
}
public void doSomethingBasedOnClassB(){ // method declaration => +1
System.out.println (classB.toString()); // call (System.out.println) => 0 because already counted on line 5 + call (toString) => +1
}
}
@przodownikR1
przodownikR1 / xml
Created January 5, 2014 23:16
filtering_pom
<profiles>
<profile>
<id>weblogic</id>
<properties>
<environment>weblogic</environment>
</properties>
</profile>
<profile>
<id>jetty</id>
<properties>
@przodownikR1
przodownikR1 / xml
Created January 6, 2014 00:12
dependency_list
[INFO] ------------------------------------------------------------------------
[INFO] Building refactor_mark 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:list (default-cli) @ refactor_mark ---
[INFO]
[INFO] The following files have been resolved:
[INFO] org.easytesting:fest-util:jar:1.1.6:compile
[INFO] junit:junit:jar:4.11:test
[INFO] ch.qos.logback:logback-core:jar:1.0.13:compile
@przodownikR1
przodownikR1 / xml
Created January 6, 2014 00:14
mvn_dependency_tree_details
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building refactor_mark 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ refactor_mark ---
[INFO] pl.java.borowiec:refactor_mark:jar:1.0.0-SNAPSHOT
[INFO] +- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] +- org.slf4j:slf4j-ext:jar:1.7.5:compile
[INFO] | \- ch.qos.cal10n:cal10n-api:jar:0.7.4:compile
@przodownikR1
przodownikR1 / xml
Created January 6, 2014 00:16
mvn_help_settings
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- -->
<!-- Generated by Maven Help Plugin on 2014-01-06T01:15:27 -->
<!-- See: http://maven.apache.org/plugins/maven-help-plugin/ -->
<!-- -->
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<!-- -->
@przodownikR1
przodownikR1 / gist:8276084
Created January 6, 2014 00:18
mvn versions:display-dependency-updates
[INFO] ------------------------------------------------------------------------
[INFO] Building refactor_mark 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.1:display-dependency-updates (default-cli) @ refactor_mark ---
[INFO] artifact ch.qos.logback:logback-access: checking for updates from nexus
[INFO] artifact ch.qos.logback:logback-classic: checking for updates from nexus
[INFO] artifact ch.qos.logback:logback-core: checking for updates from nexus
[INFO] artifact junit:junit: checking for updates from nexus
[INFO] artifact org.easytesting:fest-assert: checking for updates from nexus
@przodownikR1
przodownikR1 / gist:8276099
Created January 6, 2014 00:20
mvn versions:display-plugin-updates
INFO] artifact org.apache.maven.plugins:maven-resources-plugin: checking for updates from nexus
[INFO] artifact org.apache.maven.plugins:maven-site-plugin: checking for updates from nexus
[INFO] artifact org.apache.maven.plugins:maven-source-plugin: checking for updates from nexus
[INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from nexus
[INFO] artifact org.codehaus.groovy.maven:gmaven-plugin: checking for updates from nexus
[INFO]
[INFO] The following plugin updates are available:
[INFO] com.mycila.maven-license-plugin:maven-license-plugin 1.8.0 -> 1.10.b1
[INFO] maven-compiler-plugin .................................. 2.3.2 -> 3.1
[INFO] maven-enforcer-plugin .................................. 1.3 -> 1.3.1
@przodownikR1
przodownikR1 / gist:8276454
Created January 6, 2014 01:06
compiler_help_compile
mvn compiler:help
[INFO] ------------------------------------------------------------------------
[INFO] Building refactor_mark 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:help (default-cli) @ refactor_mark ---
[INFO] org.apache.maven.plugins:maven-compiler-plugin:2.3.2
Maven Compiler Plugin