行家 - j2objc - 没有目标已为此建立

问题描述:

我想建立j2objc但得到下一个错误指定的,当我发出make dist命令:行家 - j2objc - 没有目标已为此建立

[ERROR] No plugin found for prefix 'dependency' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/lera/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [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/NoPl.. 
make[1]: *** [/j2objc-0.9.8.2.1/java_deps/build_result/.maven_generate] Error 1 
make: *** [java_deps_dist] Error 2 

然后我尝试了mvn -X命令:

No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1] 
org.apache.maven.lifecycle.NoGoalSpecifiedException: No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:94) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) 
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) 
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) 
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 
    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:497) 
    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) 
[ERROR] 
[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/NoGoalSpecifiedException 

我也跟着这些建议:Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved它并没有帮助因为:

  1. maven存储服务器已启动;
  2. 我不在代理之后;
  3. 它不是关于Eclipse的;
  4. 我删除了我的本地maven仓库中的所有内容 - 没有任何改变;
  5. 自动下载并安装了依赖插件 - 没有帮助。

我甚至试图将相应的行添加到maven settings.xml中的pluginGroups中,但它也没有帮助。 j2objc的开发者提到该项目只使用Maven,所以其依赖的罐子被本地复制

我还建议尝试mvn -X generate-resources dependency:sources命令,但我得到下一组信息:

[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.5: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.5 
    org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.5 
     at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:117) 
     at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:179) 
     at org.apache.maven.plugin.DefaultBuildPluginManager.loadPlugin(DefaultBuildPluginManager.java:83) 
     at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolveFromProject(DefaultPluginPrefixResolver.java:138) 
     at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolveFromProject(DefaultPluginPrefixResolver.java:121) 
     at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:85) 
     at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix(MojoDescriptorCreator.java:265) 
     at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:219) 
     at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:103) 
     at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:83) 
     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:89) 
     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 
     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) 
     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) 
     at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) 
     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) 
     at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 
     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:497) 
     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) 

等诸多原因中列出。

的POM文件:

<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.google.j2objc</groupId> 
    <artifactId>j2objc</artifactId> 
    <packaging>pom</packaging> 
    <version>0.9.1</version> 
    <name>j2objc</name> 
    <url>https://github.com/google/j2objc/</url> 

    <build> 
    <directory>build_result</directory> 
    <plugins> 
     <!-- Copy dependent jars --> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-dependency-plugin</artifactId> 
     <version>2.5</version> 
     <executions> 
      <execution> 
      <id>copy-dependencies</id> 
      <phase>generate-resources</phase> 
      <goals> 
       <goal>copy-dependencies</goal> 
      </goals> 
      <configuration> 
       <outputDirectory>${project.build.directory}</outputDirectory> 
       <excludeTransitive>true</excludeTransitive> 
      </configuration> 
      </execution> 
      <execution> 
      <id>copy-sources</id> 
      <phase>generate-resources</phase> 
      <goals> 
       <goal>copy</goal> 
      </goals> 
      <configuration> 
       <artifactItems> 
       <artifactItem> 
        <groupId>javax.inject</groupId> 
        <artifactId>javax.inject</artifactId> 
        <classifier>sources</classifier> 
       </artifactItem> 
       <artifactItem> 
        <groupId>junit</groupId> 
        <artifactId>junit</artifactId> 
        <classifier>sources</classifier> 
       </artifactItem> 
       <artifactItem> 
        <groupId>org.hamcrest</groupId> 
        <artifactId>hamcrest-core</artifactId> 
        <classifier>sources</classifier> 
       </artifactItem> 
       <artifactItem> 
        <groupId>org.mockito</groupId> 
        <artifactId>mockito-core</artifactId> 
        <classifier>sources</classifier> 
       </artifactItem> 
       </artifactItems> 
       <outputDirectory>${project.build.directory}</outputDirectory> 
       <excludeTransitive>true</excludeTransitive> 
      </configuration> 
      </execution> 
     </executions> 
     </plugin> 
    </plugins> 
    </build> 

    <dependencies> 
    <dependency> 
     <groupId>com.google.guava</groupId> 
     <artifactId>guava</artifactId> 
     <version>18.0</version> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.google.code.findbugs</groupId> 
     <artifactId>jsr305</artifactId> 
     <version>3.0.0</version> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.birt.runtime</groupId> 
     <artifactId>org.eclipse.core.contenttype</artifactId> 
     <version>3.4.200.v20140207-1251</version> 
     <exclusions> 
     <exclusion> 
      <groupId>org.eclipse.equinox</groupId> 
      <artifactId>org.eclipse.equinox.registry</artifactId> 
     </exclusion> 
     </exclusions> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.birt.runtime</groupId> 
     <artifactId>org.eclipse.core.jobs</artifactId> 
     <version>3.6.1.v20141014-1248</version> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.birt.runtime</groupId> 
     <artifactId>org.eclipse.core.resources</artifactId> 
     <version>3.9.1.v20140825-1431</version> 
     <exclusions> 
     <exclusion> 
      <groupId>org.eclipse.core</groupId> 
      <artifactId>org.eclipse.core.expressions</artifactId> 
     </exclusion> 
     <exclusion> 
      <groupId>org.eclipse.core</groupId> 
      <artifactId>org.eclipse.core.filesystem</artifactId> 
     </exclusion> 
     </exclusions> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.birt.runtime</groupId> 
     <artifactId>org.eclipse.core.runtime</artifactId> 
     <version>3.10.0.v20140318-2214</version> 
     <exclusions> 
     <exclusion> 
      <groupId>org.eclipse.equinox</groupId> 
      <artifactId>org.eclipse.equinox.app</artifactId> 
     </exclusion> 
     <exclusion> 
      <groupId>org.eclipse.equinox</groupId> 
      <artifactId>org.eclipse.equinox.registry</artifactId> 
     </exclusion> 
     <exclusion> 
      <groupId>org.eclipse.core.runtime.compatibility</groupId> 
      <artifactId>auth</artifactId> 
     </exclusion> 
     </exclusions> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.birt.runtime</groupId> 
     <artifactId>org.eclipse.equinox.common</artifactId> 
     <version>3.6.200.v20130402-1505</version> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.birt.runtime</groupId> 
     <artifactId>org.eclipse.equinox.preferences</artifactId> 
     <version>3.5.200.v20140224-1527</version> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.tycho</groupId> 
     <artifactId>org.eclipse.jdt.compiler.apt</artifactId> 
     <version>1.1.0.v20140509-1235</version> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.tycho</groupId> 
     <artifactId>org.eclipse.jdt.core</artifactId> 
     <version>3.10.0.v20140604-1726</version> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.birt.runtime</groupId> 
     <artifactId>org.eclipse.osgi</artifactId> 
     <version>3.10.2.v20150203-1939</version> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.text</groupId> 
     <artifactId>org.eclipse.text</artifactId> 
     <version>3.5.101</version> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.11</version> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.hamcrest</groupId> 
     <artifactId>hamcrest-core</artifactId> 
     <version>1.3</version> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.mockito</groupId> 
     <artifactId>mockito-core</artifactId> 
     <version>1.9.5</version> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>javax.inject</groupId> 
     <artifactId>javax.inject</artifactId> 
     <version>1</version> 
     <scope>compile</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.googlecode.jarjar</groupId> 
     <artifactId>jarjar</artifactId> 
     <version>1.3</version> 
    </dependency> 
    <dependency> 
     <groupId>com.google.doclava</groupId> 
     <artifactId>doclava</artifactId> 
     <version>1.0.6</version> 
    </dependency> 
    <dependency> 
     <groupId>com.google.jsilver</groupId> 
     <artifactId>jsilver</artifactId> 
     <version>1.0.0</version> 
     <scope>provided</scope> 
    </dependency> 
    </dependencies> 
</project> 

应该提到的是我是新来的Maven和正在使用的Hackintosh所以任何帮助,将不胜感激!提前致谢。

+0

可以分享pom.xml文件吗? –

+0

@RicardNàcherRoig是的,当然。我编辑了问题 –

+0

我很抱歉,我不知道你想做什么。我执行了 mvn -X generate-resources dependency:sources *并且它工作。看起来您的互联网连接由于某种原因失败,或者您的本地存储库已损坏。你可以删除/重命名你的本地存储库吗?它在你的家.m2 \ repository中,并且尝试* mvn generate-resources * –

问题是关于我的Hackintosh操作系统。如果你想尝试在Hackintosh中安装j2objc,你可能会遇到同样的障碍。我建议你在实际的OS X中使用它。非常感谢你的帮助!