Monday, October 17, 2016

Daily Git commands

Here are some of Git commands that I am using daily:
# removes last commit
git reset --hard HEAD~1
# shows branches with last commits
git branch -v
# show commits in current branch
git log --oneline
# shows information about remote repo
git remote show origin

Useful Maven plugins

Today I would like to share some useful Maven plugins:
  • exec-maven-plugin
    • executes JAR with mvn exec:java command
  • maven-jar-plugin
    • builds an executable JAR
  • maven-dependency-plugin
    • adds dependencies to lib/ folder
  • maven-assembly-plugin
    • includes dependencies to jar

    org.codehaus.mojo
    exec-maven-plugin
    1.1
    
        com.package.Main
    


    org.apache.maven.plugins
    maven-jar-plugin
    2.4
    
        
            
                true
                lib/
                com.package.Main
            
        
    


    org.apache.maven.plugins
    maven-dependency-plugin
    
        
            copy
            package
            
                copy-dependencies
            
            
                
                    ${project.build.directory}/lib
                
            
        
    


    maven-assembly-plugin
    
        
            package
            
                single
            
        
    
    
        
            jar-with-dependencies
        
        
            
                ${mainClass}