"maven" maven various wonderful problems

Source: Internet
Author: User

Issue 1:could not calculate build plan:plugin org.apache ... The MAVEN project could not be created successfully

Workaround 1:

Http://repo1.maven.org/maven2 This central warehouse address has been blocked and inaccessible, so maven's plugin and jar download failed, And your local repository on your PC. M2 does not download maven plugins, and the project naturally does not perform the MAVEN commands properly. Workaround, 1. If you do not have a personal computer (such as a Nexus), copy the local repository. M2 directory to your computer and set the <localRepository> to. M2 directory in Maven conf settings.xml. 2. On the settings.xml, configure the Nexus address to download from it.

Question 2:

Go to Maven project is the generated pom.xml file error--unknown packaging:apk and failed to collect dependencies for xxx.xx ... generation2:android-maven.plugin:3.5.3 ...

Description, because there is no way to reproduce the error, it is not clear that the specific error content, but the error hints in the <packaging>apk</packaging> and the first line of the solution, add local library support, Because things in the Central Library are sometimes not accessible, so we use local <repositories>
<repository>
<id>my-internal-site</id>
<url>file:///${env. Home}/.m2/repository</url>
</repository>
  </repositories> Maybe that's the reason, I'm not sure, but it does not make an error.   Problem 3: pom.xml file error--cannot read lifecycle mapping metadata for artifact ... Description, this error is seen in problems this attempt, point to the first line of the Pom.xml file, the solution is to delete ~\.m2\repository this folder, and then the local library to re-download from the Central Library   problems 4:  Execute Command mvn clean install error--could not found tool ' aapt ' description, SDK Aapt.exe is used to package the APK file, but its location is very strange, Api4 is located in the Tools folder under the Android-4 folder in the Platforms folder, While Api17 is located in the Build-tools 17.0.0 folder, Maven seems to execute the command when the Pom.xml file to find the Platform property, if it is 4, then go to the corresponding Platforms folder Andoird-4 folder below to find Aapt.exe, but If it is 10, this is not found, because there is no android-10\tools\aapt.exe this file, so of course the error solution, we need to manually copy, copy all the contents under build-tools\17.0.0 to Android-10\ Tools folder (you need to create your own Tools folder). Why use the 17.0.0 under the Aapt.exe, the following will also be said.   Problem 5:  execute command mvn clean install error--mojoexecutionexception:android-040-001:could not Execute:command ... Description, which generally means that there is no way to execute a AAPT command, similar to a command that cannot execute D:\Android\Android_SDK\platforms\android-4\tools\aapt.exe package-m-j g:\ Project Document \ECLIPSE3\AAA\TARGET\GENERATED-SOURCES\R-M g:\ Project document \eclipse3\aaa\androidmanifest.xml-s g:\ project file \eclipse3\aAa\res--auto-add-overlay-a g:\ Project Document \eclipse3\aaa\assets-i D:\Android\Android_SDK\platforms\android-4\ Android.jar We execute this command alone in the console, and the output is "command line too long", I really have no words. Workaround, find ways to reduce the structure of the folder ....   Problem 6:  execute command mvn clean install error--mojoexecutionexception:android-040-001:could not Execute:command ... Description, the command is still not executed after the reduction, but this time the command is like this D:\Android\Android_SDK\platforms\android-4\tools\aapt.exe package-f-M G:\a\aaa\ Androidmanifest.xml-s G:\a\aaa\res--auto-add-overlay-a G:\a\aaa\target\generated-sources\combined-assets\assets- I D:\Android\Android_SDK\platforms\android-4\android.jar-F G:\a\aaa\target\aaa.ap_--debug-mode One more--debug-mode, We are alone in the console to execute this command, we will find that the prompt shows that AAPT does not support--debug-mode this parameter, and so on, the pit dad. Then I used the build-tools below the Aapt.exe found can use this parameter, so you understand why I have to copy 17.0.0 folder under the Aapt.exe of the solution, delete android-4 the following aapt related files, from the 17.0.0 folder to copy things over.   Issue 7: Select Run As-maven install error in eclipse right-click Project--complier could not found,perhaps you is running on a JRE rather than a JD K Description, not urgent too clear, anyway meaning is not found compiler, said we may use the installed JRE run instead of the JDK inside the JRE run. Workaround, Window-preferences-javA-installed JREs, select Add, find your JDK path, select the JDK, do not select jre  Problem 8: Error dependency--missing when adding artifact in pom.xml ... Description, modify Pom.xml and save, MAVEN will go to the Central library (may be inside the enterprise) to update the local library, sometimes the network condition is poor when the connection Central Library timeout, then there will be missing artifact wrong solution, in the. m2/ Repo ... Folder below to find this artifact folder, delete, and then re-save Pom.xml, of course, if still timeout, find a way to do it yourself.

Issue 9:no Android SDK path could be found
Description, sometimes Maven is not able to find the path to the SDK, even if you configure the ANDROID_HOME environment variable, you need to create a setting.xml file under the $home/.m2 folder, add the following configuration information to it
<settings xmlns= "http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance "Xsi:schemalocation=" http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd ">
<profiles>
<profile>
<id>android</id>
<properties>
<android.sdk.path> PATH/TO/THE/ANDROID/SDK </android.sdk.path>
</properties>
</profile>
</profiles>
<activeProfiles>
<!--make the profiles active all the time--<activeProfile>android</activeProfile> </ Activeprofiles>
</settings>

"maven" maven various wonderful problems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.