maven-profile-selector

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Maven Profile Selector

Maven Profile 选择器

This skill helps you select and manage Maven profiles for different network configurations.
本Skill可帮助您为不同的网络配置选择和管理Maven profiles。

When to Use This Skill

何时使用本Skill

Use this skill when the user:
  • Switch between different network environments (e.g., development, staging, production) that require different Maven profiles.
当用户需要以下操作时使用本Skill:
  • 在不同的网络环境(如开发、预发布、生产)之间切换,而这些环境需要不同的Maven profiles。

Workflow

工作流程

  1. Ensure
    mvn
    is installed and available in the system PATH.
  2. Check the
    settings.xml
    file for available profiles relative to
    mvn
    , such as
    mvn
    's
    conf
    directory.
  3. Present the user with a list of available profiles and their descriptions.
  4. Allow the user to select a profile.
  5. Ask the user whether to change profile, and if confirmed, set the selected profile as the active profile for Maven commands.
  6. For all subsequent Maven commands, use the selected profile until the user decides to switch again. Replace './mvnw' with
    mvn
    and add
    -P <selected_profile>
    .
  1. 确保
    mvn
    已安装且在系统PATH中可用。
  2. 检查
    settings.xml
    文件中与
    mvn
    相关的可用profiles,例如
    mvn
    conf
    目录下的配置。
  3. 向用户展示可用profiles的列表及其描述。
  4. 允许用户选择一个profile。
  5. 询问用户是否要更改profile,若确认,则将所选profile设置为Maven命令的激活profile。
  6. 在后续所有Maven命令中,使用所选profile,直到用户决定再次切换。将'./mvnw'替换为
    mvn
    并添加
    -P <selected_profile>
    参数。

Example

示例

User: I need to switch environment for my Maven project. Assistant: Sure! Here are the available Maven profiles in your
settings.xml
:
  1. Home - Profile for Home environment
  2. Stuff - Profile for Stuff environment
  3. Trip - Profile for Trip environment Please select the profile you want to use (1, 2, or 3).
用户:我需要为我的Maven项目切换环境。 助手:没问题!以下是您
settings.xml
中的可用Maven profiles:
  1. Home - 家庭环境专用Profile
  2. Stuff - 办公环境专用Profile
  3. Trip - 差旅环境专用Profile 请选择您要使用的profile(1、2或3)。