5

I want to use kSoap2-android library from the official site http://simpligility.github.io/ksoap2-android/index.html, but I don't know how can I make a jar from the github project https://github.com/simpligility/ksoap2-android.

Thanks in advance!

Mateut Alin
  • 1,173
  • 4
  • 17
  • 34

2 Answers2

3

You can follow this step by step procedure to get .jar:

  1. Click the Clone or download button, and click Download ZIP.
  2. Extract the downloaded zip file to a folder somewhere.
  3. Go into the folder that contains the src directory and the gradlew files
  4. Shift-right-click, click Open command window here
  5. Enter gradlew.bat setupDecompWorkspace
  6. Enter gradlew.bat shadowJar
  7. The JAR file is in the build folder, inside the libs folder.

Hope this helps you.

Siddharth Sheth
  • 207
  • 2
  • 6
1

The project has a pom.xml so it can be built with maven.

It also has a maven wrapper script (mvnw), so you can run it without even having maven on your computer.

EDIT : sorry, I did not see that you only wanted one subproject. try :

mvn install -pl ksoap2-android -am
Jeremy Grand
  • 2,300
  • 12
  • 18
  • I'm new to maven... Do you mean to run in bash something like this `mvn clean tomcat7:redeploy`? I've tried but it gives me some errors... – Mateut Alin Apr 04 '17 at 10:48
  • You need to either run mvn package in a shell or just execute the mvnw (if you are on UNIX, or mvnw.bat if you are on windows) – Jeremy Grand Apr 04 '17 at 11:56
  • I ran `mvn package` but it made a jar for each package in the project. Can i avoid this? – Mateut Alin Apr 04 '17 at 13:43
  • Thanks for try, but the project is called *ksoap2-android-master* and has a package called *ksoap2-android*. Using `mvn install -pl ksoap2-android -am` generate a `jar` only on the *ksoap2-android* package. – Mateut Alin Apr 05 '17 at 07:27
  • @MateutAlin yes it's what it does. But what do you want ? That maven magically creates a single jar containing all sub-projects ? You have to rewrite the pom.xml to make it do what you want (which is not what the developers intended). They have a repository with several subprojects because they answer different needs. – Jeremy Grand Apr 05 '17 at 07:46
  • I saw an earlier version of the same project (containing the sub-projects) that was packed in a single jar and I thought that it's some magic that I don't understand. Anyway, thank you for clarifying me and sorry for this silly question. – Mateut Alin Apr 05 '17 at 11:18