vault backup: 2026-05-30 16:02:33

This commit is contained in:
Rainyy21
2026-05-30 16:02:33 -04:00
commit 96449f8968
43 changed files with 2837 additions and 0 deletions
@@ -0,0 +1,55 @@
---
tags:
- devop
- video
- poetry
- python
up: "[[00_devop_note]]"
related:
- "[[Poetry]]"
- "[[poetry_guide]]"
- "[[poetry_project_ideas]]"
source:
author:
published:
---
# Poetry: Dependency Management for Python
Poetry is a tool for **dependency management** and **packaging** in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. Poetry offers a lockfile to ensure repeatable installs, and can build your project for distribution.
## Similarities to Maven (Java)
If you are familiar with Apache Maven, you can think of Poetry as serving a similar purpose in the Python ecosystem:
| Feature | Maven (Java) | Poetry (Python) |
| :--- | :--- | :--- |
| **Project Configuration** | `pom.xml` | `pyproject.toml` |
| **Dependency Resolution** | Resolves transitive dependencies | Resolves transitive dependencies with a deterministic solver |
| **Locking** | No direct equivalent (uses version ranges in POM) | `poetry.lock` (ensures exact versions) |
| **Build & Packaging** | Builds JAR/WAR files | Builds Wheel and sdist packages |
| **Publishing** | Deploys to Central/Nexus | Publishes to PyPI or private repositories |
| **Environment Management**| Relies on external JRE/JDK | Manages Virtual Environments automatically |
## Key Concepts
### 1. `pyproject.toml`
This is the single source of truth for your project. It replaces `setup.py`, `requirements.txt`, `setup.cfg`, `MANIFEST.in` and `pipfile`.
### 2. Deterministic Resolution
Poetry comes with a custom dependency resolver that will always find a solution if one exists, or clearly explain why it failed.
### 3. Isolation by Default
Poetry always runs in isolation. It either uses your existing virtual environment or creates its own to ensure that your project dependencies don't leak into your global Python installation.
## Basic Commands
- `poetry init`: Interactively create a `pyproject.toml` file.
- `poetry add <package>`: Adds a dependency to `pyproject.toml` and installs it.
- `poetry install`: Installs the dependencies specified in `pyproject.toml` (or `poetry.lock` if present).
- `poetry update`: Updates dependencies to their latest versions according to `pyproject.toml` and updates the lock file.
- `poetry run <command>`: Runs a command within the project's virtual environment.
- `poetry shell`: Spawns a shell within the virtual environment.
## Why use Poetry over Pip?
While `pip` is the standard package installer, it doesn't handle dependency resolution or project metadata as comprehensively as Poetry. Poetry provides a more "all-in-one" experience, much like Maven does for Java, by combining dependency management, environment isolation, and packaging into a single tool.
@@ -0,0 +1,87 @@
---
tags:
- devop
- video
- maven
- java
up: "[[00_devop_note]]"
related: "[[Maven]]"
source: https://www.youtube.com/watch?v=T00NKLQvwYE
author: Cameron McKenzie (TheServerSide)
published: 2023-08-27
---
# Learn Apache Maven Full Tutorial in Java for Beginners
> An hour-long beginner-friendly course that walks through Apache Maven from scratch — installation, configuration, core commands, dependencies, plugins, and integrations with Jenkins and Docker.
## Overview
Apache Maven is the most widely used build automation tool in the Java ecosystem (used by ~70% of Java organizations). This tutorial progresses from foundational concepts (installing Java/JDK and Maven) through to advanced topics like building cloud-native microservices and CI/CD integration.
## Topics Covered
### 1. Getting Started
- What Maven is and what it enables developers to do
- Installing the JDK (prerequisite)
- Downloading, installing, and configuring Maven
- Verifying the install with `mvn -v`
### 2. Core Maven Commands
- `mvn compile` — compile source code
- `mvn test` — run unit tests
- `mvn package` — bundle compiled code into a JAR/WAR
- `mvn install` — install artifact into local repo
- `mvn deploy` — push artifact to a remote repo
- `mvn clean` — wipe the `target/` directory
### 3. The POM File (`pom.xml`)
- The heart of every Maven project
- POM types (parent, aggregator, effective POM)
- Properties and how they control build behavior
- Project coordinates: `groupId`, `artifactId`, `version`
### 4. Dependency Management
- Declaring dependencies
- **Scopes**: `compile`, `provided`, `runtime`, `test`, `system`
- External dependencies
- Exclusions and optional dependencies
- How Maven resolves transitive dependencies
### 5. Plugins
- Plugins extend Maven's core functionality
- Commonly used:
- **Compiler Plugin** — controls the Java source/target version
- **Surefire Plugin** — runs unit tests
- When to add a plugin vs. rely on defaults
### 6. Maven vs. Gradle
- Comparison of the two dominant JVM build tools
- Tradeoffs: XML configuration (Maven) vs. Groovy/Kotlin DSL (Gradle)
- Why Maven still dominates enterprise Java
### 7. IDE Integration
- Creating and managing Maven projects in **IntelliJ IDEA** and **Eclipse**
- Building projects from the IDE
- Creating executable JARs
- Handling multi-module projects
### 8. DevOps Integration
- **Maven + Jenkins** — running builds in CI pipelines
- **Maven + Docker** — packaging artifacts into Docker images
- Building cloud-native microservices
## Key Takeaways
- Maven is *opinionated* — follow the standard directory layout (`src/main/java`, `src/test/java`) and most things just work
- The `pom.xml` is declarative; you describe *what* the project is, not *how* to build it
- Dependency scopes matter — using `test` scope keeps test libraries out of production artifacts
- Plugins are how Maven gets extended; nearly every advanced behavior is plugin-driven
## Actionable Next Steps
- [ ] Install JDK and Maven; verify with `mvn -v`
- [ ] Generate a starter project: `mvn archetype:generate`
- [ ] Try the full lifecycle: `mvn clean package`
- [ ] Add a dependency from [Maven Central](https://search.maven.org)
- [ ] Wire a simple project into Jenkins or Docker
## Source
- Video: [Learn Apache Maven Full Tutorial in Java for Beginners](https://www.youtube.com/watch?v=T00NKLQvwYE)
- Companion article: [TheServerSide — Learn Maven tutorial for beginners](https://www.theserverside.com/video/Learn-Maven-tutorial-for-beginners)