Opened 3 years ago

Closed 13 months ago

#5139 closed defect (rejected)

Can't build with Ant/Maven

Reported by: asmirnov Assignee:
Priority: P4 Milestone:
Module: Libadblockplus-Android Keywords:
Cc: Blocked By: #6300
Blocking: Platform: Android
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description

Environment

We do support Ant, Maven and Gradle for building. However starting some time i'm unable to build with Ant and Maven.

How to reproduce

  1. clone libadblockplus-android repo
  2. create local.properties files
  3. run Maven to build the project
  4. make sure build fails

...

Observed behaviour

build error:

$mvn clean compile
[INFO] Scanning for projects...
[WARNING] The POM for com.google.android:android:jar:5.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] parent
[INFO] libadblockplus-android
[INFO] libadblockplus-android-webview
[INFO] libadblockplus-android-settings
[INFO] libadblockplus-android-webviewapp
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building parent 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ parent ---
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building libadblockplus-android 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-antrun-plugin:1.8:run (ant-clean) @ library ---
[INFO] Executing tasks

main:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] parent ............................................. SUCCESS [  0.055 s]
[INFO] libadblockplus-android ............................. FAILURE [  0.418 s]
[INFO] libadblockplus-android-webview ..................... SKIPPED
[INFO] libadblockplus-android-settings .................... SKIPPED
[INFO] libadblockplus-android-webviewapp .................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.402 s
[INFO] Finished at: 2017-04-14T12:44:11+05:00
[INFO] Final Memory: 21M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (ant-clean) on project library: An Ant BuildException has occured: The following error occurred while executing this line:
[ERROR] /Users/asmirnov/Documents/dev/src/libadblockplus-android.ssh/libadblockplus-android/build.xml:75: Cannot find /Users/asmirnov/Library/Android/sdk/tools/ant/build.xml imported from /Users/asmirnov/Documents/dev/src/libadblockplus-android.ssh/libadblockplus-android/build.xml
[ERROR] around Ant part ...<ant antfile="/Users/asmirnov/Documents/dev/src/libadblockplus-android.ssh/libadblockplus-android/build.xml" target="-pre-clean"/>... @ 4:133 in /Users/asmirnov/Documents/dev/src/libadblockplus-android.ssh/libadblockplus-android/target/antrun/build-main.xml
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :library

Expected behaviour

The build succeeds

Change History (4)

comment:1 Changed 3 years ago by asmirnov

It's because Android team has removed Ant scripts from SDK in 25.3.0 (as they consider Ant to be deprecated tool for Android):
https://developer.android.com/studio/releases/sdk-tools.html

...
SDK Tools, Revision 25.3.0 (March 2017)
...
Changes:
...
Obsolete/deprecated tools have been removed:
...
ant scripts

So "build.xml" is not just missing in tools/ant/build.xml as whole tools/ant directory is missing.
I believe we should remove Ant support too. Otherwise we should mention about max SDK Tools version in README.

The problem is that Maven depends on Ant tasks and runs it . behind the scene.
So we should remove it too or make it independent of Ant.

comment:2 Changed 22 months ago by asmirnov

  • Blocked By 6300 added

comment:3 Changed 13 months ago by asmirnov

We've removed Ant and Maven support because Gradle is now mostly used for building of Android projects.

comment:4 Changed 13 months ago by asmirnov

  • Resolution set to rejected
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.