microsoft / microsoft/vscode-java-pack

Enabling java.autobuild.enabled causes the spring.profiles.active to be set to the default profile irrespective of the profile used for the maven build

未关闭
#466 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

ai-triaged bug
主要语言
TypeScript
星标
352
派生
166
平均合并
17 小时 47 分钟
30 天内合并 PR
32

描述

Issue Type: Bug

  1. Create a Spring.Boot application
  2. Create two profiles in the pom.xml -
<profiles>
  <profile>
    <id>uat</id>
    <properties>
      <maven.test.skip>true</maven.test.skip>
      <activatedProperties>uat</activatedProperties>
    </properties>
    <build>
      <finalName>${project.artifactId}-${project.version}-uat</finalName>
    </build>
  </profile>

  <profile>
    <id>dev</id>
    <activation>
      <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
      <activatedProperties>dev</activatedProperties>
      <maven.test.skip>true</maven.test.skip>
    </properties>
    <build>
      <finalName>${project.artifactId}-${project.version}-dev</finalName>
    </build>
  </profile>
</profiles>
  1. Create an application.properties file for the Spring.Boot application and add the following -
    spring.profiles.active=@activatedProperties@
  2. Set "java.autobuild.enabled": true in settings.json
  3. Execute a maven build from within the VS Code environment -
    mvn clean package -Puat
  4. Note the contents of the target application.properties file which will contain -
    spring.profiles.active=dev
  5. Set "java.autobuild.enabled": false in settings.json
  6. Execute a maven build from within the VS Code environment -
    mvn clean package -Puat
  7. Note the contents of the target application.properties file which will contain -
    spring.profiles.active=uat

Note: If VS Code is closed and the maven command is used from a command window then the issue does not occur.

Extension version: 0.10.0
VS Code version: Code 1.47.3 (91899dcef7b8110878ea59626991a18c8a6a1b3e, 2020-07-23T13:12:49.994Z)
OS version: Windows_NT x64 10.0.14393

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (4 x 3592)
GPU Status 2d_canvas: unavailable_software
flash_3d: disabled_software
flash_stage3d: disabled_software
flash_stage3d_baseline: disabled_software
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: disabled_off
rasterization: disabled_software
skia_renderer: disabled_off_ok
video_decode: disabled_software
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: unavailable_software
webgl2: unavailable_software
Load (avg) undefined
Memory (System) 10.00GB (6.20GB free)
Process Argv
Screen Reader no
VM 0%
Extension Author (truncated) Version
vscode-tomcat ada 0.11.3
file-templates brp 1.2.0
xml Dot 2.5.1
mssql ms- 1.9.0
vs-keybindings ms- 0.2.0
vscode-boot-dev-pack Piv 0.0.8
vscode-concourse Piv 1.20.0
vscode-manifest-yaml Piv 1.20.0
vscode-spring-boot Piv 1.20.0
vscode-jsp pth 0.0.3
java red 0.65.0
vscode-xml red 0.13.0
vscode-iq-plugin Son 0.7.4
vscodeintellicode Vis 1.2.10
vscode-java-debug vsc 0.27.1
vscode-java-dependency vsc 0.11.0
vscode-java-pack vsc 0.10.0
vscode-java-test vsc 0.24.0
vscode-maven vsc 0.24.0
vscode-spring-boot-dashboard vsc 0.1.10
vscode-spring-initializr vsc 0.4.8
markdown-all-in-one yzh 3.2.0

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

通过启用 java.autobuild.enabled、使用 Maven profiles,并比较执行 mvn clean package -Puat 后生成的 application.properties 文件,重现 settings.json 的问题。跟踪 VS Code Java 自动构建的入口点,并验证生成的 profile 仍为 uat,与在 VS Code 外部运行的构建一致。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, spring-boot, vscode
领域
build-system, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。