I have started since 2 days learning Maven & using goals as deploy and install.So I hv used this command:
mvn install android:deploy
Note:clean,install commands work fine
this is what I get:
[ERROR] No plugin found for prefix 'android' in the current project
and in the plugin groups [com.cryptolog.maven.plugins,
org.apache.maven.plugins, org.codehaus.mojo] available from the
repositories [local (/home/yougostt/.m2/repository), central
and this is the pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>univer.lib.androidtestxmlrpc</groupId>
<artifactId>android_xmlrpc</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.cryptolog.rpc</groupId>
<artifactId>libxmlrpc</artifactId>
<version>${rpc.version}</version>
</dependency>
<dependency>
<groupId>com.cryptolog.rpc</groupId>
<artifactId>libxmlrpc-client</artifactId>
<version>${rpc.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<properties>
<rpc.version>3.7</rpc.version>
</properties>
</project>
How can I fix it please?
Supposing you are using the com.simpligilty.maven.plugins Android Maven Plugin (but the same would also work for any other plugin), you can add to your pom the following (as also explained by its official usage page:
<build>
<plugins>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>4.4.1</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
If instead you are using the Jayway Androind Maven Plugin, the configuration would look like (as also explained by the official Spring guide:
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.9.0-rc.1</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
Related
Few days back my maven project was running fine. Out of nowhere I started getting this weird error.
org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration)
I am attaching image also to show how it actually shows this error.
My pom file looks like this...
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>SS</artifactId>
<groupId>com.rolta.dss</groupId>
<version>5.2.0.16</version>
</parent>
<artifactId>AndroidImpl</artifactId>
<packaging>apk</packaging>
<name>AndroidImpl</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<platform.version></platform.version>
<android.plugin.version>3.8.2</android.plugin.version>
<jdk.version>6</jdk.version>
<jdk>${env.JAVA_HOME}</jdk>
</properties>
<dependencies>
<dependency>
<groupId>com.rolta.dss</groupId>
<artifactId>Core</artifactId>
<version>5.2.0.16</version>
</dependency>
<dependency>
<groupId>com.rolta.support</groupId>
<artifactId>android-support</artifactId>
<version>v13</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${env.BUILD_NAME}</finalName>
<sourceDirectory>src</sourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.9.0-rc.2</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>19</platform>
</sdk>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<executable>${jdk}/bin/javac</executable>
<fork>true</fork>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<jvm>${jdk}/bin/java</jvm>
<forkMode>once</forkMode>
</configuration>
</plugin>
</plugins>
</build>
</project>
I have tried removing .m2 folder, checked if any of the dependency was missing in .m2 folder(everything is present). When i do maven clean and maven install i get build success message. I have also checked jdk version(it's 1.6).Even i tried in new eclipse still the issue persists.
Is there anything else which i am missing? Thanks in advance.
The issue is related with the m2e-plugin in eclipse. You can verify by running
maven from commandline (which you already did), which should give no error.
It's because of UTF-8 formatted (BOM at the beginning) pom.
https://github.com/tesla/m2eclipse-mavenarchiver/issues/6
You could try with the latest: https://otto.takari.io/content/sites/m2e.extras/m2eclipse-mavenarchiver/0.17.0/N/LATEST/
While searching the cause of the issue i stumbled on this link eclipse issue with the pom
So I checked my current version of the m2e plugin and the sonatype version it was something
m2e - Maven Integration for Eclipse 1.4.0.20130601-0317 org.eclipse.m2e.feature.feature.group and
0.17.0.201502101659 org.sonatype.m2e.mavenarchiver.feature.feature.group Sonatype, Inc. respectively.
I checked current version this way (Help > about eclipse > installation details)
Then i uninstalled those two plugins and issue was resolved.
To uninstall (Help > about eclipse > installation details > select the plugin > uninstall)
I uninstalled them because i wanted to upgrade the m2e to the latest version i.e 1.6 update m2e link
I was unable to upgrade due to someother reason so i tried uninstalling the previous version and thought of updating the latest one. But once I uninstalled the previous version issue was resolved.
Hii everyone I am trying to generate automated Maven build script for android project i'm using Maven 3.2.5 for generating build and i'm getting following issues while trying to generate script for sample helloworld project
Exception in thread "pool-1-thread-1"java.lang.NoClassDefFoundError:org/eclipse/aether/spi/connector/Transfer$State
at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:608)
i'm using following script for building
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.helloworld</groupId>
<artifactId>HelloWorld</artifactId>
<version>0.1.0</version>
<packaging>apk</packaging>
<properties>
<!-- use UTF-8 for everything -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v4</artifactId>
<version>21.0.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.9.0-rc.1</version>
<configuration>
<sdk>
<platform>21</platform>
</sdk>
<deleteConflictingFiles>true</deleteConflictingFiles>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
tried changing and searched in google didn't find solution please help me
It seems that there is a compatibility issues between android-maven-plugin and the maven release 3.2.5 and later.
For me it works on a 3.2.3 and fails with NoClassDefFoundError exception when I use 3.2.5 and 3.3.1
Try to download an older maven version from the archives at
http://archive.apache.org/dist/maven/maven-3/3.2.3/
Edit
This issue is fixed in later versions(testet with 4.1.1) of the android-maven-plugin. The plugin has moved to github, and is relocated to a new groupId.
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>4.1.1</version>
</plugin>
New project location:
https://github.com/simpligility/android-maven-plugin/
There is some compatibility problem for maven 3.2 & 3.3. Try this:
brew install homebrew/versions/maven31
sudo ln -s /usr/local/Cellar/maven31/3.1.1 /usr/local/Cellar/maven/
brew switch maven 3.1.1
I have been trying to add ActionBarSherlock Maven dependecy on my project and i'm getting some problems. When i use ABS themes like:
<style name="AppThemeCustomizada" parent="#style/Sherlock.__Theme.DarkActionBar">
I get the following error:
No resource found that matches the given name '#style/Sherlock.__Theme.DarkActionBar'.
Here is my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>RunasProject</groupId>
<artifactId>RunasProject</artifactId>
<version>1.0.1-SNAPSHOT</version>
<name>Runas</name>
<dependencies>
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>actionbarsherlock</artifactId>
<version>4.4.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>actionbarsherlock</artifactId>
<version>4.4.0</version>
<type>apklib</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<extensions>true</extensions>
<configuration>
<source>1.6</source>
<target>1.6</target>
<sdk>
<platform>8</platform>
</sdk>
</configuration>
</plugin>
</plugins>
</build>
I have tried many suggestion on net, but i could not solve the problem. ABS classes work fine, but styles don't.
You have to change the packaging of your project to apk and use the Android Maven Plugin. Your configuration is mixing setup from the Android Maven Plugin into the Compiler plugin. That wont work. Check out the sample applications (including an ABS demo) of the Android Maven Plugin.
I'm starting a project which I want to compile with both Eclipse and Maven. On command line everything works fine and if I remove Maven nature the project runs OK in Eclipse. However with Maven enabled I get this error in first line of the POM
dependency=[com.actionbarsherlock:actionbarsherlock:apklib:4.2.0:compile]
not found in workspace
Here's my complete POM
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.foo.bar</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>apk</packaging>
<name>test</name>
<properties>
<java.version>1.6</java.version>
<platform.version> 4.1.1.4</platform.version>
<android.platform>16</android.platform>
<android-support.version>r7</android-support.version>
<abs-version>4.2.0</abs-version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${platform.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
<version>${android-support.version}</version>
</dependency>
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>actionbarsherlock</artifactId>
<version>${abs-version}</version>
<type>apklib</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
<sdk>
<platform>${android.platform}</platform>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
I also noticed that there's no link to ABS from Eclipse->Properties->Android->Library
What am I missing in this setup?
Like you I compile with Maven and Eclipse, however I do not use the maven nature as it was too painful when I tried to use it.
Given that your error mentions ABS and that is a APKLIB which is kinda "faked" by Maven you might want ensure that this APKLIB is installed into your local maven repo. I dont believe that the maven nature supports workspace resolution but I could be wrong in this.
If that doesnt work you can always follow my example and just set eclipse up they default way which would mean turning off the maven nature and linking using Eclipse->Properties->Android->Library as you mentioned
I was stuck with this and tried the following and it worked:
right click on project → maven → update project configuration → select all → enjoy!
Just moving my Android project over to Maven / Jenkins and am exploring the build / compile / testing procedures.
Issue:
I introduced a simple compilation error in the java code, but when i run mvn clean install package I get a build success. It's only when I deploy the App to my device that it crashes and fails.
Is there something wrong with my POM?
ps. I have XXXXX'd out some info. Don't worry about it.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>xxxxx</groupId>
<artifactId>xxxxxx</artifactId>
<version>1.0.0</version>
</parent>
<groupId>xxxxx</groupId>
<artifactId>xxxx</artifactId>
<version>1.0.0</version>
<packaging>apk</packaging>
<name>Android App</name>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.0.1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>library</artifactId>
<version>4.0.0</version>
<type>apklib</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<nativeLibrariesDirectory>${project.basedir}/src/main/native</nativeLibrariesDirectory>
<sdk>
<platform>15</platform>
<path>/Users/aidenfry/android-sdks</path>
</sdk>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
I suspect, that the reason you're not seeing an error is most likely because maven didn't even bother compiling your classes in the first place.
Maven has various conventions, and one of them is that it expects your sourcecode to be located under src/main/java.
I'm betting that you've just dropped the above pom.xml into your project root area and run mvn clean install. Maven will happily run that, but since you've probably left your source files in the default IDE locations, maven just skips over it. Have a look in your target directory and you'll see it hasn't compiled any classes in there for you
You have 2 options:
Add this somewhere inside the <build> tags in the above pom :
${basedir}/src
Re-arrange your source files so they follow the src/main/java structure.
Personally, I'd opt for number 2.
P.S, there is also src/main/test too, test classes should go there :)
You can read more about the configuration of the pom file here