Files
netdisk-fast-download/parser/pom.xml
q adff2bab89 feat: 使用 graalpy-maven-plugin 自动安装 requests pip 包
- parser/pom.xml: 添加 packages 配置让 Maven 自动安装 requests 及其依赖
  - 移除手动 pip 安装依赖,改为 Maven 构建时自动安装
  - 添加注释说明 python-lsp-server 仍需 setup-graalpy-packages.sh

- README.md: 更新本地构建文档
  - Maven 现在自动安装 requests 核心包
  - setup-graalpy-packages.sh 变为可选(仅 Playground 代码提示需要)

- PyContextPool.java: 更新注释和错误消息
  - 说明 pip 包来源变化
  - 更新 requests 不可用时的提示信息
2026-01-12 18:59:19 +08:00

316 lines
12 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.qaiu</groupId>
<artifactId>netdisk-fast-download</artifactId>
<version>${revision}</version>
</parent>
<groupId>cn.qaiu</groupId>
<artifactId>parser</artifactId>
<version>10.2.3</version>
<packaging>jar</packaging>
<name>cn.qaiu:parser</name>
<description>NFD parser module</description>
<url>https://qaiu.top</url>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/license/mit</url>
</license>
</licenses>
<developers>
<developer>
<name>qaiu</name>
<email>qaiu00@gmail.com</email>
<organization>https://qaiu.top</organization>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/qaiu/netdisk-fast-download.git</connection>
<developerConnection>scm:git:ssh://git@github.com:qaiu/netdisk-fast-download.git</developerConnection>
<url>https://github.com/qaiu/netdisk-fast-download</url>
</scm>
<distributionManagement>
<snapshotRepository>
<id>sonatype</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>sonatype</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<properties>
<revision>0.1.8</revision>
<java.version>17</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Versions -->
<vertx.version>4.5.23</vertx.version>
<org.reflections.version>0.10.2</org.reflections.version>
<lombok.version>1.18.38</lombok.version>
<slf4j.version>2.0.5</slf4j.version>
<commons-lang3.version>3.18.0</commons-lang3.version>
<jackson.version>2.14.2</jackson.version>
<logback.version>1.5.19</logback.version>
<junit.version>4.13.2</junit.version>
<!-- GraalPy -->
<graalpy.version>24.1.1</graalpy.version>
</properties>
<dependencies>
<!-- Logging -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- Vert.x Web Client -->
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web-client</artifactId>
<version>${vertx.version}</version>
</dependency>
<!-- Common Utils -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<!-- Script Engine -->
<dependency>
<groupId>org.openjdk.nashorn</groupId>
<artifactId>nashorn-core</artifactId>
<version>15.4</version>
<scope>compile</scope>
</dependency>
<!-- GraalPy Python Runtime -->
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>polyglot</artifactId>
<version>${graalpy.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>python</artifactId>
<version>${graalpy.version}</version>
<type>pom</type>
</dependency>
<!-- GraalPy Python 包资源支持 -->
<dependency>
<groupId>org.graalvm.python</groupId>
<artifactId>python-embedding</artifactId>
<version>${graalpy.version}</version>
</dependency>
<!-- GraalPy LLVM 支持 - 允许多 Context 使用原生模块 (如 unicodedata) -->
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>llvm-community</artifactId>
<version>${graalpy.version}</version>
<type>pom</type>
</dependency>
<!-- Compression (Brotli) -->
<dependency>
<groupId>org.brotli</groupId>
<artifactId>dec</artifactId>
<version>0.1.2</version>
</dependency>
<!-- Unit Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- GraalPy Maven Plugin - 创建 Python Home 和 venv自动安装 pip 包 -->
<!--
注意: python-lsp-server 依赖 ujson需编译 C 扩展GraalPy pip 无法安装。
如需 python-lsp-server 功能,请运行 setup-graalpy-packages.sh 使用系统 pip 安装。
此处只配置 requests 及其纯 Python 依赖Maven 构建时会自动安装到
target/classes/org.graalvm.python.vfs/venv/lib/python3.11/site-packages/
-->
<plugin>
<groupId>org.graalvm.python</groupId>
<artifactId>graalpy-maven-plugin</artifactId>
<version>${graalpy.version}</version>
<configuration>
<!-- pip 包列表 - 仅纯 Python 包 -->
<packages>
<!-- requests 及其依赖 - HTTP 客户端 (解析器核心功能必需) -->
<package>requests</package>
<package>urllib3</package>
<package>charset_normalizer</package>
<package>idna</package>
<package>certifi</package>
</packages>
</configuration>
<executions>
<execution>
<id>prepare-python-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>process-graalpy-resources</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- 编译 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<release>${maven.compiler.source}</release>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<!-- 打包源码 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Javadoc (空包防验证失败) -->
<!-- Javadoc兼容新版配置无需源码中存在注释 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.7.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<!-- 忽略 Javadoc 错误 -->
<failOnError>false</failOnError>
<!-- 禁用 doclint新版参数名改为 additionalOptions -->
<additionalOptions>-Xdoclint:none</additionalOptions>
<!-- 如果项目源码中几乎没有 Javadoc可设 true -->
<quiet>true</quiet>
</configuration>
</execution>
</executions>
</plugin>
<!-- GPG 签名(新版插件推荐写法) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- 避免在 CI 环境出现 TTY 错误 -->
<gpgArguments>
<arg>--batch</arg>
<arg>--yes</arg>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<!-- Sonatype Central 自动发布 -->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.6.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>sonatype</publishingServerId>
<autoPublish>true</autoPublish>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
<configuration>
<updatePomFile>true</updatePomFile>
<outputDirectory>${project.basedir}</outputDirectory>
<flattenMode>ossrh</flattenMode>
</configuration>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<pomFile>${project.basedir}/.flattened-pom.xml</pomFile>
</configuration>
</plugin>
</plugins>
</build>
</project>