Rate this page:
This guide describes building a Bitbucket Server distribution from the source code. Bitbucket Server source code is available to all commercial license holders.
If you're really sure you want to modify Bitbucket Server's source instead of building a plugin, here are the steps for building Bitbucket Server from source:
Download and install the Java Development Kit.
Bitbucket Server requires the JDK 1.8 Update 45 release or higher.
Download and extract the
Bitbucket Server source distribution
Use your my.atlassian.com account to login (or contact Atlassian's
sales department if you do not see the link to download the distribution).
Bitbucket Server is built using Maven, which is bundled with the source distribution. During the build, Maven will download the dependencies of Bitbucket Server and store them locally. Two of those dependencies are Oracle's and Microsoft's database drivers, which need to be manually installed for legal reasons. If you do not have those drivers in your local Maven repository, follow these instructions to install them:
And, in the same directory (containing the source distribution of Bitbucket Server), run the following command:
1
./mvn3.sh install:install-file -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar -Dfile=ojdbc8.jar -Dmaven.repo.local="`pwd`/localrepo"
1
mvn3.bat install:install-file -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar -Dfile=ojdbc8.jar -Dmaven.repo.local="%CD%\localrepo"
Next, download the Microsoft JDBC driver:
/tmp/ms-driver
),1 2 3 4
export MS_DRIVER_PATH="/tmp/ms-driver"
./mvn3.sh install:install-file -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc -Dversion=4.0.2206 -Dpackaging=jar -Dfile=$MS_DRIVER_PATH/enu/sqljdbc.jar -Dmaven.repo.local="`pwd`/localrepo"
./mvn3.sh install:install-file -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc_auth -Dversion=4.0.2206 -Dclassifier=x64 -Dpackaging=dll -Dtype=dll -Dfile=$MS_DRIVER_PATH/enu/auth/x64/sqljdbc_auth.dll -Dmaven.repo.local="`pwd`/localrepo"
./mvn3.sh install:install-file -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc_auth -Dversion=4.0.2206 -Dclassifier=x86 -Dpackaging=dll -Dtype=dll -Dfile=$MS_DRIVER_PATH/enu/auth/x86/sqljdbc_auth.dll -Dmaven.repo.local="`pwd`/localrepo"
1 2 3 4
set MS_DRIVER_PATH=c:\Users\USERNAME\Downloads\Microsoft JDBC Driver 4.0 for SQL Server
mvn3.bat install:install-file -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc -Dversion=4.0.2206 -Dpackaging=jar -Dfile="%MS_DRIVER_PATH%\sqljdbc_4.0\enu\sqljdbc.jar" -Dmaven.repo.local="%CD%\localrepo"
mvn3.bat install:install-file -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc_auth -Dversion=4.0.2206 -Dclassifier=x64 -Dpackaging=dll -Dtype=dll -Dfile="%MS_DRIVER_PATH%\sqljdbc_4.0\enu\auth\x64\sqljdbc_auth.dll" -Dmaven.repo.local="%CD%\localrepo"
mvn3.bat install:install-file -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc_auth -Dversion=4.0.2206 -Dclassifier=x86 -Dpackaging=dll -Dtype=dll -Dfile="%MS_DRIVER_PATH%\sqljdbc_4.0\enu\auth\x86\sqljdbc_auth.dll" -Dmaven.repo.local="%CD%\localrepo"
Run the following command in the directory containing the source distribution of Bitbucket Server:
1
./build.sh
1
build.bat
This will perform a full build of Bitbucket Server. The distribution ZIP will be created in the subdirectory bitbucket-parent/distribution/default/target
.
Then, to develop Bitbucket Server in your IDE:
Alternatively, from the command line:
build.sh
or build.bat
in the step 1), run:1 2
cd bitbucket-parent/webapp/default
mvn cargo:run
build.sh
or build.bat
.Rate this page: