Closed kukuxiahuni closed 1 year ago
When the error occurred, go to Output Maven for Java
, see what was printed there.
so the content of xxxx.profiles.txt
in your screenshot? this extension directly parse output from there.
BTW if you can stably reproduce it, a sample project can be shared, that would be more helpful.
I think the code have a little problem。
const profiles: MavenProfile[] = [];
const regexp = /Profile Id: (.*) \(Active: (true|false) , Source: (.*)\)/g;
let match: RegExpExecArray | null;
do {
match = regexp.exec(output);
if (match != null && match.length === 4) {
const id = match[1];
const active = match[2] === "true";
const source = match[3];
if (!profiles.find(p => p.id === id)) {
const profile = new MavenProfile(project, id, active, source);
profiles.push(profile);
}
}
} while (match !== null);
return profiles;
}
maybe there is an extra space。
/Profile Id: (.*) \(Active: (true|false) , Source: (.*)\)/g
Profile Id: dev (Active: true, Source: pom)
this is my test code
var pattern = /Profile Id: (.*) \(Active: (true|false) , Source: (.*)\)/,
str = 'Profile Id: dev (Active: true, Source: pom)';
console.log(pattern.test(str));
may can
var pattern = /Profile Id: (.*) \(Active: (true|false)(.*), Source: (.*)\)/,
str = 'Profile Id: dev (Active: true, Source: pom)';
console.log(pattern.test(str));
Good catch. Probably it's due to some changes in maven-help-plugin 3.4.0, released last month. see https://github.com/apache/maven-help-plugin/releases/tag/maven-help-plugin-3.4.0
Yes, we should update the regexp to make it more robust and you provided a good example.
Talking about the implementation, instead of adding (.*)
, I would prefer to \s?
indicating there can be an optional whitespace char.
Let us know if you are interested in creating a PR, otherwise we'll fix it on our own. /cc @testforstephen
Wating for your fix. i am newer in javascript, study hard.
in my new project is ok. Maybe the old project created by idea, the new one created by vscode. but the cit
/crm
come from setting.xml.
[INFO] --- help:3.3.0:all-profiles (default-cli) @ chaos ---
[INFO] Listing Profiles for Project: com.sankun.chatgpt:chaos:jar:0.0.1-SNAPSHOT
Profile Id: cit (Active: true , Source: settings.xml)
Profile Id: crm (Active: true , Source: settings.xml)
Profile Id: native (Active: false , Source: pom)
Profile Id: nativeTest (Active: false , Source: pom)
[INFO] --- help:3.3.0:all-profiles (default-cli) @ chaos ---
That's because your new project is using maven-help-plugin 3.3.0.
Wating for your fix.
No problem. I'll invite @testforstephen to provide a quick fix.
Any plan to fix this?
@synckey I created PR #980 for this.
@testforstephen please take a look.
@synckey I created PR #980 for this.
@testforstephen please take a look.
Really sweet for this
How about this bug?
Describe the bug first i can not sure this is a bug. but in my vscode I get different show. I hava two maven project, the one can show the profiles and the other not. sometimes
Background process terminated with code 127.
How to fix them??
Expected behavior can list the maybe problems or the notices.
Environments (please complete the following information as much as possible):