You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by ke...@apache.org on 2022/09/07 14:13:22 UTC

[skywalking-eyes] branch maven/optional created (now 0c15e5a)

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a change to branch maven/optional
in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git


      at 0c15e5a  Fix optional dependencies are not excluded

This branch includes the following new commits:

     new 0c15e5a  Fix optional dependencies are not excluded

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[skywalking-eyes] 01/01: Fix optional dependencies are not excluded

Posted by ke...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch maven/optional
in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git

commit 0c15e5a24be44c416de0e816269de194355f8095
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Wed Sep 7 22:13:11 2022 +0800

    Fix optional dependencies are not excluded
---
 pkg/deps/maven.go      | 2 +-
 pkg/deps/maven_test.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/deps/maven.go b/pkg/deps/maven.go
index 7220823..513df3d 100644
--- a/pkg/deps/maven.go
+++ b/pkg/deps/maven.go
@@ -320,7 +320,7 @@ func LoadDependenciesTree(data []byte) []*Dependency {
 	stack := []Elem{}
 	unique := make(map[string]struct{})
 
-	reFind := regexp.MustCompile(`(?im)^.*? ([| ]*)(\+-|\\-) (?P<gid>\b.+?):(?P<aid>\b.+?):(?P<packaging>\b.+)(:\b.+)?:(?P<version>\b.+):(?P<scope>\b.+?)$`) //nolint:lll // can't break down regex
+	reFind := regexp.MustCompile(`(?im)^.*? ([| ]*)(\+-|\\-) (?P<gid>\b.+?):(?P<aid>\b.+?):(?P<packaging>\b.+)(:\b.+)?:(?P<version>\b.+):(?P<scope>\b.+?)(?P<optional>\b.+?)?$`) //nolint:lll // can't break down regex
 	rawDeps := reFind.FindAllSubmatch(data, -1)
 
 	deps := make([]*Dependency, 0, len(rawDeps))
diff --git a/pkg/deps/maven_test.go b/pkg/deps/maven_test.go
index c1f190c..6a835bb 100644
--- a/pkg/deps/maven_test.go
+++ b/pkg/deps/maven_test.go
@@ -49,7 +49,7 @@ func TestCanResolvePomFile(t *testing.T) {
 }
 
 func writeFile(fileName, content string) error {
-	file, err := os.OpenFile(fileName, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0666)
+	file, err := os.OpenFile(fileName, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0777)
 	if err != nil {
 		return err
 	}