Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AEM build with same Java as set for instance #126

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/aem/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ func (c *CLI) printCommandResult() {
func (c *CLI) printDataValue() {
value, ok := c.outputResponse.Data[c.outputValue]
if !ok {
println("<undefined>")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is nasty;

it writes to both STDOUT and STDERR

then in bash scripts value captured from subshell needs to be redirected

fmt.Println("<undefined>")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this writes only to STDOUT as expected

} else {
println(fmtx.MarshalText(value))
fmt.Println(fmtx.MarshalText(value))
}
}

Expand Down
15 changes: 15 additions & 0 deletions cmd/aem/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,21 @@ func (c *CLI) instanceInitCmd() *cobra.Command {
c.Error(err)
return
}

javaHome, err := c.aem.JavaOpts().FindHomeDir()
if err != nil {
c.Error(err)
return
}
c.SetOutput("javaHome", javaHome)

javaExecutable, err := c.aem.JavaOpts().Executable()
if err != nil {
c.Error(err)
return
}
c.SetOutput("javaExecutable", javaExecutable)

c.SetOutput("initialized", true)
c.Changed("initialized prerequisites for instance(s)")
},
Expand Down
6 changes: 4 additions & 2 deletions pkg/project/app_classic/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,11 @@ tasks:
generates:
- all/target/*.all-*.zip
env:
AEM_BUILD_ARGS: '' # '-PfedDev -DskipTests'
AEM_BUILD_ARGS: -PfedDev
AEM_BUILD_JAVA_HOME:
sh: sh aemw instance init --output-value javaHome
cmds:
- mvn clean package {{ .AEM_BUILD_ARGS }}
- JAVA_HOME=AEM_BUILD_JAVA_HOME mvn clean package $AEM_BUILD_ARGS

aem:deploy:
desc: deploy AEM application
Expand Down
6 changes: 4 additions & 2 deletions pkg/project/app_cloud/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,11 @@ tasks:
generates:
- all/target/*.all-*.zip
env:
AEM_BUILD_ARGS: '' # '-PfedDev -DskipTests'
AEM_BUILD_ARGS: -PfedDev
AEM_BUILD_JAVA_HOME:
sh: sh aemw instance init --output-value javaHome
cmds:
- mvn clean package {{ .AEM_BUILD_ARGS }}
- JAVA_HOME=AEM_BUILD_JAVA_HOME mvn clean package $AEM_BUILD_ARGS

aem:deploy:
desc: deploy AEM application
Expand Down