我尝试使用PAHO在 Android 上创建一个 MQTT 项目。
根据描述,我将源代码克隆到我的电脑,并使用
mvn 干净安装
构建项目。
我下载了 org.eclipse.paho.mqtt.java-1.0.0,并期望得到:
- org.eclipse.paho.client.mqttv3-1.0.0.jar 和
- org.eclipse.paho.android.service-1.0.0.jar
但是运行 mvn clean install 后,我只能得到 org.eclipse.paho.client.mqttv3-1.0.0.jar,所以无法构建项目。
这是消息输出:
C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.and roid.service>mvn install -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model fororg.eclipse.paho:android-service:jar:0.1
[WARNING] 'version' contains an expression but should be a constant. @ org.eclipse.paho:java-parent:${paho.version}, C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\pom.xml, line 7, column 11
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ line 95, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building android-service 0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- templating-maven-plugin:1.0-alpha-3:filter-sources (filter-src) @ android-service ---
[INFO] Request to add 'C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\src\main\java-templates' folder. Not added since it does not exist.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ android-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3:compile (default-compile) @ android-service ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-bundle-plugin:2.3.7:manifest (generate-manifest) @ android-service ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.910 s
[INFO] Finished at: 2015-01-15T13:16:59+08:00
[INFO] Final Memory: 13M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.7:manifest (generate-manifest) on project android-service: Cannot find C:\Users\Janniin\
Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\target\classes (manifest goal must be run after compile phase) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.7:manifest (generate-manifest) on projec
t android-service: Cannot find C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\target\classes (manifest goal must b
e run after compile phase)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot find C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\target\classes (manifest goal must be run after compile phase)
at org.apache.felix.bundleplugin.ManifestPlugin.execute(ManifestPlugin.java:73)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:264)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:255)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.io.FileNotFoundException: C:\Users\Janniin\Downloads\org.eclipse.paho.mqtt.java-1.0.0\org.eclipse.paho.android.service\target\classes
at org.apache.felix.bundleplugin.ManifestPlugin.getAnalyzer(ManifestPlugin.java:175)
at org.apache.felix.bundleplugin.ManifestPlugin.getManifest(ManifestPlugin.java:114)
at org.apache.felix.bundleplugin.ManifestPlugin.execute(ManifestPlugin.java:69)
... 23 more
[ERROR]
[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
谁能给我一些建议来解决这个问题?
多谢!!