Skip to content

Instantly share code, notes, and snippets.

View vanpeerdevelopment's full-sized avatar

Dieter Van Peer vanpeerdevelopment

View GitHub Profile
@vanpeerdevelopment
vanpeerdevelopment / batch-parameters.bat
Last active January 1, 2016 07:39
This gist shows the usage of batch parameters in a bat file and shows how to extract extra information about its location or its parameters.
SET BAT_FILE = %0
SET FIRST_ARG = %1
SET SECOND_ARG = %2
SET FIRST_ARG_WITHOUT_QUOTES = %~1
SET BAT_DRIVE = %~d0
SET BAT_PATH = %~p0
SET BAT_FOLDER = %~dp0
REM Suppose batch-parameters is located in C:\BatFolder\
REM When executing batch-parameters.bat "C:\First" "D:\Second"
@vanpeerdevelopment
vanpeerdevelopment / maven-setup.bat
Last active January 1, 2016 07:49
Example setup of maven environment variables.
REM It is assumed that Java and Maven are installed in C:\Development
SET JAVA_HOME=C:\Development\Java
SET M2_HOME=C:\Development\Maven
SET PATH=%M2_HOME%\bin;%PATH%
@vanpeerdevelopment
vanpeerdevelopment / push-popd.bat
Created December 24, 2013 15:38
Bat file to show the usage of pushd and popd to go back to the directory the bat file was run from.
pushd %1
pushd ..
REM Do some work here.
popd
popd
@vanpeerdevelopment
vanpeerdevelopment / maven-startup.bat
Last active January 1, 2016 10:39
This code example shows the command that is used every time the mvn command is executed.
java.exe %MAVEN_OPTS% -classpath \boot\plexus-classworlds.jar ...
@vanpeerdevelopment
vanpeerdevelopment / without-maven_opts.bat
Created December 26, 2013 12:21
Example to show executing maven with an environment variable passed to the mvn command.
mvn -Dmaven.repo.local=C:\repository clean install
...
mvn -Dmaven.repo.local=C:\repository clean install
...
@vanpeerdevelopment
vanpeerdevelopment / with-maven_opts.bat
Created December 26, 2013 12:26
Example to show executing maven with an environment variable passed via MAVEN_OPTS.
SET MAVEN_OPTS=-Dmaven.repo.local=C:\repository
mvn clean install
...
mvn clean install
...
@vanpeerdevelopment
vanpeerdevelopment / maven-memory-settings.bat
Created December 26, 2013 12:52
Setting the heap and permgen space for maven.
SET MAVEN_OPTS=-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m
@vanpeerdevelopment
vanpeerdevelopment / maven-settings.bat
Created December 26, 2013 13:27
Commands to execute maven with specific user and/or global settings
mvn -s \location\of\user\settings clean install
mvn --settings \location\of\user\settings clean install
mvn -gs \location\of\global\settings clean install
mvn --global-settings \location\of\global\settings clean install
@vanpeerdevelopment
vanpeerdevelopment / local-repository.xml
Last active January 1, 2016 10:49
Maven settings file setting the location of the local repository.
<settings>
<!-- Set the location using an absolute path -->
<localRepository>\location\of\local\repo</localRepository>
<!-- Set the location by evaluating an environment variable -->
<localRepository>${M2_LOCAL_REPO}</localRepository>
</settings>
@vanpeerdevelopment
vanpeerdevelopment / development-environment.txt
Created December 26, 2013 20:37
Directory structure of the development environment setup.
| -Project
| -Installation-Files
| -Java
| -Maven
| -Maven-Repository
| -Eclipse
| -Eclipse-Workspace
| -Environment
| -Shortcuts
| -environment.bat