[ 
https://issues.apache.org/jira/browse/AXIS2-6085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17937499#comment-17937499
 ] 

Jeff Thomas commented on AXIS2-6085:
------------------------------------

Here is what I did to get the build running from IntelliJ under WSL Ubuntu 
(gathered from various blogs / stackoverflow / etc.)
 # Install WSL

Open Powershell in Administrator mode and install WSL

{code:java}
wsl --install {code}
You will need to set a user and password for the default Ubuntu installation.

Recommended to restart your machine after successful installation.


 # Open WSL (Windows-Start / WSL)


{code:java}
wsl -d Ubuntu{code}

 # Install a JDK

I use Temurin 17 JDK so I did the following:


{code:java}
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo 
apt-key add -
echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= 
'/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee 
/etc/apt/sources.list.d/adoptium.list
sudo apt update
sudo apt install temurin-17-jdk
sudo update-alternatives --config java
java --version{code}

The first two lines add the GPG key for Adoptium and thee APT repository

The 'update-alternatives' command you pick the JDK you want to use as default 
(here Temurin 17)


 # Install Maven


{code:java}
sudo apt install maven
 mvn --version{code}

 # Firewall - not my area of expertise:

Windows Start -> Windows Defender Firewall with Advanced Security

Then in the dialog, in the middle "Overview" section click thee link "Windows 
Defender Firewall Properties"

In the "Public Profile" tab, click the "Customize" button for "Protected 
network connections" and _*uncheck*_ the "vEthernet (WSL (Hyper-V firewall")) 
and apply changes

!image-2025-03-21-20-01-05-733.png|width=775,height=446!


 # In IntelliJ - open a Maven Run Configuration and modify it:

!image-2025-03-21-20-04-10-460.png|width=581,height=289!

Choose for "Run on:" the option WSL.

!image-2025-03-21-20-06-18-567.png|width=434,height=347!

If WSL is setup correctly, IntelliJ will perform some introspection and 
determine what Linux Distribution is installed:

!image-2025-03-21-20-08-02-689.png|width=595,height=234!

Click next and provide information about Java and Maven Home

!image-2025-03-21-20-09-16-086.png|width=726,height=627!

Hit OK and now your build should be setup to run on WSL.

ATTENTION: IntelliJ uses the default user that was specified when the Ubuntu 
image was installed - so it will not pick up your windows "~/.m2/settings.xml". 
 So if you have server entries or proxies setup they won't bee found.

To work around this you can do the following:


{code:java}
wsl -d Ubuntu # starts a shell in the Ubuntu WSL distribution

rm -fr ~/.m2  # remove .m2 directory in home if it exists
ln -s /mnt/c/Users/JeffW/.m2 ~/.m2    # link mounted "/mnt/c/Users/***/.m2" to 
the WSL "~/.m2"

{code}
To test this you can run a WSL maven build and make sure that your settings are 
picked up.

!image-2025-03-21-21-04-03-302.png|width=628,height=253!

After a lot of trial and error:

!image-2025-03-21-21-05-56-048.png|width=964,height=129!

> Build instructions in README don't mention bash requirement
> -----------------------------------------------------------
>
>                 Key: AXIS2-6085
>                 URL: https://issues.apache.org/jira/browse/AXIS2-6085
>             Project: Axis2
>          Issue Type: Improvement
>          Components: documentation
>    Affects Versions: 2.0.0
>         Environment: Windows / IntelliJ IDE 
>            Reporter: Jeff Thomas
>            Priority: Minor
>             Fix For: 2.0.1
>
>         Attachments: image-2025-03-21-20-01-05-733.png, 
> image-2025-03-21-20-04-10-460.png, image-2025-03-21-20-05-36-762.png, 
> image-2025-03-21-20-06-18-567.png, image-2025-03-21-20-08-02-689.png, 
> image-2025-03-21-20-09-16-086.png, image-2025-03-21-21-04-03-302.png, 
> image-2025-03-21-21-05-56-048.png
>
>
> When building from source there is the following hint:
> {code:java}
> 1) Manually "mvn install" both of the plugins in the following places:
>    
>    modules/tool/axis2-mar-maven-plugin
>    modules/tool/axis2-aar-maven-plugin {code}
> If building on Windows from an IDE (for me IntelliJ) this will most likely 
> fail because the maven-aar-plugin build attempts to run a bash script in the 
> verify phase.
> I was able to get this to work from the command-line in a git-bash shell. 
> (Update: took the time to get Windows WSL up and running and this works fine 
> too)
> Here there could be a little more clarity about the bash requirement.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org
For additional commands, e-mail: java-dev-h...@axis.apache.org

Reply via email to