I've been using IntelliJ CE but I want to try using VSCode.
1 thing I always do is to create 2 debug configuration (Remote JVM) for author and publisher. I'm trying to do this in VSCode but it seems to recognize only 1.
I first created 1 debug configuration in launch.json and that was working well. I can do breakpoints in my code. I tried adding another 1 for publisher (everything is the same except for name and port) and I see no way of selecting the 2nd debug configuration.
Any ideas on how to do it? Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
HI @jayv25585659 ,
Yes, you can use VSCode for AEM Sites Java development. Here are the steps to create multiple debug configurations for author and publisher:
Open your AEM project in VSCode.
Open the Debug view by clicking on the Debug icon in the left-hand sidebar.
Click on the "create a launch.json file" link to create a new launch configuration file.
In the launch.json file, create a new configuration for the author instance by adding the following code:
{
"type": "java",
"name": "AEM Author",
"request": "attach",
"hostName": "localhost",
"port": 30303
}
{
"type": "java",
"name": "AEM Publisher",
"request": "attach",
"hostName": "localhost",
"port": 30304
}
Save the launch.json file.
Start your AEM author and publisher instances.
In VSCode, select the "AEM Author" configuration from the dropdown in the Debug view and click on the "Start Debugging" button.
Set breakpoints in your code and test the author instance.
Stop the author instance and select the "AEM Publisher" configuration from the dropdown in the Debug view.
Click on the "Start Debugging" button to start debugging the publisher instance.
Note: Make sure that the port numbers in the launch.json file match the port numbers of your AEM author and publisher instances. Also, ensure that the AEM instances are running and accessible before starting the debugging session
HI @jayv25585659 ,
Yes, you can use VSCode for AEM Sites Java development. Here are the steps to create multiple debug configurations for author and publisher:
Open your AEM project in VSCode.
Open the Debug view by clicking on the Debug icon in the left-hand sidebar.
Click on the "create a launch.json file" link to create a new launch configuration file.
In the launch.json file, create a new configuration for the author instance by adding the following code:
{
"type": "java",
"name": "AEM Author",
"request": "attach",
"hostName": "localhost",
"port": 30303
}
{
"type": "java",
"name": "AEM Publisher",
"request": "attach",
"hostName": "localhost",
"port": 30304
}
Save the launch.json file.
Start your AEM author and publisher instances.
In VSCode, select the "AEM Author" configuration from the dropdown in the Debug view and click on the "Start Debugging" button.
Set breakpoints in your code and test the author instance.
Stop the author instance and select the "AEM Publisher" configuration from the dropdown in the Debug view.
Click on the "Start Debugging" button to start debugging the publisher instance.
Note: Make sure that the port numbers in the launch.json file match the port numbers of your AEM author and publisher instances. Also, ensure that the AEM instances are running and accessible before starting the debugging session
let me try. I was not aware (it was not obvious) there's a a dropdown list in debug view. thank you.
Views
Replies
Total Likes
Try to add configurations for both the author and publisher (below). In the Debug view, there should be a dropdown menu at the top where you can select the debug configuration. You should see both "AEM Author" and "AEM Publisher" listed here.
launch.json
looks something like this:
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "AEM Author",
"request": "attach",
"hostName": "localhost",
"port": 30303
},
{
"type": "java",
"name": "AEM Publisher",
"request": "attach",
"hostName": "localhost",
"port": 30304
}
]
}
Start debugging:
I hope this helps!
Views
Likes
Replies