git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] lburgazzoli commented on a change in pull request #239: initial support for spring boot


lburgazzoli commented on a change in pull request #239: initial support for spring boot
URL: https://github.com/apache/camel-k/pull/239#discussion_r236038307
 
 

 ##########
 File path: pkg/builder/builder_steps.go
 ##########
 @@ -198,38 +202,44 @@ func packager(ctx *Context, selector ArtifactsSelector) error {
 	}
 	defer tarAppender.Close()
 
-	tarDir := "dependencies/"
+	tarDir := "dependencies"
 	for _, entry := range selectedArtifacts {
 		gav, err := maven.ParseGAV(entry.ID)
 		if err != nil {
 			return err
 		}
 
-		tarPath := path.Join(tarDir, gav.GroupID)
-		_, err = tarAppender.AddFile(entry.Location, tarPath)
+		_, fileName := path.Split(entry.Location)
+
+		_, err = tarAppender.AddFileWithName(gav.GroupID+"."+fileName, entry.Location, tarDir)
 		if err != nil {
 			return err
 		}
 	}
 
-	cp := ""
-	for _, entry := range ctx.Artifacts {
-		gav, err := maven.ParseGAV(entry.ID)
+	if ctx.ComputeClasspath {
+		cp := ""
+		for _, entry := range ctx.Artifacts {
+			gav, err := maven.ParseGAV(entry.ID)
+			if err != nil {
+				return nil
+			}
+			_, fileName := path.Split(entry.Location)
+			cp += path.Join(tarDir, gav.GroupID+"."+fileName) + "\n"
+		}
+
+		err = tarAppender.AppendData([]byte(cp), "classpath")
 
 Review comment:
   No, one of the build steps sets ctx.ComputeClasspath = false so the s2i-java do not include copied jar in the classpath

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@xxxxxxxxxxxxxxxx


With regards,
Apache Git Services