info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Build packages
Learn how to install and build packages different package formats.
- [Composer](#composer)
- [Conan](#conan)
- [Maven](#maven)
- [Gradle](#gradle)
- [npm](#npm)
- [Yarn](#yarn)
- [NuGet](#nuget)
- [PyPI](#pypi)
## Composer
1. Create a directory called `my-composer-package` and change to that directory:
```shell
mkdir my-composer-package && cd my-composer-package
```
1. Run [`composer init`](https://getcomposer.org/doc/03-cli.md#init) and answer the prompts.
For namespace, enter your unique [namespace](../../../user/namespace/index.md), like your GitLab username or group name.
A file called `composer.json` is created:
```json
{
"name": "<namespace>/composer-test",
"description": "Library XY",
"type": "library",
"license": "GPL-3.0-only",
"authors": [
{
"name": "John Doe",
"email": "john@example.com"
}
],
"require": {}
}
```
## Conan
### Install Conan
Download the Conan package manager to your local development environment by
following the instructions at [conan.io](https://conan.io/downloads.html).
When installation is complete, verify you can use Conan in your terminal by
running:
```shell
conan --version
```
The Conan version is printed in the output:
```plaintext
Conan version 1.20.5
```
### Install CMake
When you develop with C++ and Conan, you can select from many available
compilers. This example uses the CMake build system generator.
To install CMake:
- For Mac, use [Homebrew](https://brew.sh/) and run `brew install cmake`.
- For other operating systems, follow the instructions at [cmake.org](https://cmake.org/install/).
When installation is complete, verify you can use CMake in your terminal by
running:
```shell
cmake --version
```
The CMake version is printed in the output.
### Create a project
To test the Package Registry, you need a C++ project. If you don't already have
one, you can clone the Conan [hello world starter project](https://github.com/conan-io/hello).
### Build a Conan package
To build a package:
1. Open a terminal and navigate to your project's root folder.
1. Generate a new recipe by running `conan new` with a package name and version:
```shell
conan new Hello/0.1 -t
```
1. Create a package for the recipe by running `conan create` with the Conan user
and channel:
```shell
conan create . mycompany/beta
```
NOTE:
If you use an [instance remote](../conan_repository/index.md#add-a-remote-for-your-instance), you must
follow a specific [naming convention](../conan_repository/index.md#package-recipe-naming-convention-for-instance-remotes).
A package with the recipe `Hello/0.1@mycompany/beta` is created.
For more details about creating and managing Conan packages, see the
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 11.0.5 (Oracle Corporation 11.0.5+10)
OS: Windows 10 10.0 amd64
```
### Create a package
1. Open your terminal and create a directory to store the project.
1. From this new directory, run this command to initialize a new package:
```shell
gradle init
```
The output should be:
```plaintext
Select type of project to generate:
1: basic
2: application
3: library
4: Gradle plugin
Enter selection (default: basic) [1..4]
```
1. Enter `3` to create a new Library project. The output should be:
```plaintext
Select implementation language:
1: C++
2: Groovy
3: Java
4: Kotlin
5: Scala
6: Swift
```
1. Enter `3` to create a new Java Library project. The output should be:
```plaintext
Select build script DSL:
1: Groovy
2: Kotlin
Enter selection (default: Groovy) [1..2]
```
1. Enter `1` to create a new Java Library project that is described in Groovy DSL, or `2` to create one that is described in Kotlin DSL. The output should be:
```plaintext
Select test framework:
1: JUnit 4
2: TestNG
3: Spock
4: JUnit Jupiter
```
1. Enter `1` to initialize the project with JUnit 4 testing libraries. The output should be:
```plaintext
Project name (default: test):
```
1. Enter a project name or press <kbd>Enter</kbd> to use the directory name as project name.
## npm
### Install npm
Install Node.js and npm in your local development environment by following
the instructions at [npmjs.com](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm/).
When installation is complete, verify you can use npm in your terminal by
running:
```shell
npm --version
```
The npm version is shown in the output:
```plaintext
6.10.3
```
### Create an npm package
1. Create an empty directory.
1. Go to the directory and initialize an empty package by running:
```shell
npm init
```
1. Enter responses to the questions. Ensure the **package name** follows