当前位置: 首页 > 面试题库 >

Maven GAE原型不起作用

余善
2023-03-14
问题内容

我正在尝试将Google App
Engine与Maven一起用于基于Spring的简单应用程序。我发现有一种适用于这种Web应用程序的Maven原型(没有Spring,但是我可以自己添加):Maven
GAE。

因此,我使用了以下命令:

mvn archetype:generate -DarchetypeGroupId=net.kindleit -DarchetypeArtifactId=gae-archetype-jsp -DgroupId=com.example -DartifactId=form -DarchetypeRepository=http://maven-gae-plugin.googlecode.com/svn/repository

但是,当我尝试使用“ mvn gae:run”时,它不起作用,而且我不知道如何解决此缺失的要求:

[INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 7.444s
    [INFO] Finished at: Sat Mar 02 21:04:22 CET 2013
    [INFO] Final Memory: 6M/15M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal net.kindleit:maven-gae-plugin:0.9.5:run (default-cli) on project form: Execution default-cli of goal net.kindleit:maven-gae-plugin:0.9.5:run failed: Plugin net.kindleit:maven-gae-plugin:0.9.5 or one of its dependencies could not be resolved: Failed to collect dependencies for net.kindleit:maven-gae-plugin:jar:0.9.5 (): Failed to read artifact descriptor for net.kindleit:gae-runtime:pom:1.7.5: Failure to find net.kindleit:maven-gae-parent:pom:0.9.6-SNAPSHOT in http://download.java.net/maven/2/ was cached in the local repository, resolution will not be reattempted until the update interval of maven2-repository.dev.java.net has elapsed or updates are forced -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.kindleit:maven-gae-plugin:0.9.5:run (default-cli) on project form: Execution default-cli of goal net.kindleit:maven-gae-plugin:0.9.5:run failed: Plugin net.kindleit:maven-gae-plugin:0.9.5 or one of its dependencies could not be resolved: Failed to collect dependencies for net.kindleit:maven-gae-plugin:jar:0.9.5 ()
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
        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:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
    Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal net.kindleit:maven-gae-plugin:0.9.5:run failed: Plugin net.kindleit:maven-gae-plugin:0.9.5 or one of its dependencies could not be resolved: Failed to collect dependencies for net.kindleit:maven-gae-plugin:jar:0.9.5 ()
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:82)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
    Caused by: org.apache.maven.plugin.PluginResolutionException: Plugin net.kindleit:maven-gae-plugin:0.9.5 or one of its dependencies could not be resolved: Failed to collect dependencies for net.kindleit:maven-gae-plugin:jar:0.9.5 ()
        at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:211)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.createPluginRealm(DefaultMavenPluginManager.java:353)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupPluginRealm(DefaultMavenPluginManager.java:321)
        at org.apache.maven.plugin.DefaultBuildPluginManager.getPluginRealm(DefaultBuildPluginManager.java:175)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:78)
        ... 20 more
    Caused by: org.sonatype.aether.collection.DependencyCollectionException: Failed to collect dependencies for net.kindleit:maven-gae-plugin:jar:0.9.5 ()
        at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:258)
        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:308)
        at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:199)
        ... 24 more
    Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for net.kindleit:gae-runtime:pom:1.7.5
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:331)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
        at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(DefaultDependencyCollector.java:412)
        at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:240)
        ... 26 more
    Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Failure to find net.kindleit:maven-gae-parent:pom:0.9.6-SNAPSHOT in http://download.java.net/maven/2/ was cached in the local repository, resolution will not be reattempted until the update interval of maven2-repository.dev.java.net has elapsed or updates are forced
        at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:126)
        at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:813)
        at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:664)
        at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:310)
        at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:232)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:322)
        ... 29 more
    Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure to find net.kindleit:maven-gae-parent:pom:0.9.6-SNAPSHOT in http://download.java.net/maven/2/ was cached in the local repository, resolution will not be reattempted until the update interval of maven2-repository.dev.java.net has elapsed or updates are forced
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
        at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:122)
        ... 34 more
    Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to find net.kindleit:maven-gae-parent:pom:0.9.6-SNAPSHOT in http://download.java.net/maven/2/ was cached in the local repository, resolution will not be reattempted until the update interval of maven2-repository.dev.java.net has elapsed or updates are forced
        at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:230)
        at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:204)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:427)
        ... 37 more

可以补充一点,我尝试使用不同版本的maven-gae-plugin,但没有成功…。


问题答案:

你可以试试这个吗?

<properties>
  <gae.version>1.7.5</gae.version>
  <gae-runtime.version>1.7.5.1</gae-runtime.version>
</properties>

<plugin>
  <groupId>net.kindleit</groupId>
  <artifactId>maven-gae-plugin</artifactId>
  <version>${maven.gae.plugin.version}</version>
  <configuration>
        <unpackVersion>${gae.version}</unpackVersion>
        <serverId>appengine.google.com</serverId>
        <appDir>${webappDirectory}</appDir>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>net.kindleit</groupId>
            <artifactId>gae-runtime</artifactId>
            <version>${gae-runtime.version}</version>
            <type>pom</type>
        </dependency>
    </dependencies>
</plugin>


 类似资料:
  • 我正在建立一个maven原型。文件名替换也正常工作。例如,我有一个名为artifactd-log4j.xml的文件,当生成该文件时,将被替换。但是,其中一个xml文件(引用它的spring上下文文件)没有被替换: 由于某种原因,xml文件中的标记${artifactId}从未被替换。我的原型-metadata.xml spring-file在src/main/resources下,既然fileSe

  • 问题内容: 当ES6 Arrow函数似乎无法为使用prototype.object的对象分配功能时。请考虑以下示例: 在对象定义中显式使用arrow函数是可行的,但将Object函数与Object.prototype语法一起使用却不能: 就像概念证明一样,将Template字符串语法与Object.prototype语法一起使用确实可以: 我是否缺少明显的东西?我觉得示例2应该在逻辑上起作用,但是

  • 作为概念证明,将模板字符串语法与Object.Prototype语法一起使用确实有效: 我是不是漏掉了一些明显的东西?我觉得示例2在逻辑上应该工作,但我对输出感到困惑。我猜这是一个范围问题,但我被输出“是一个未定义的”抛了出来。 ES6小提琴

  • 问题内容: 以下代码适用于Spark 1.5.2,但不适用于Spark 2.0.0。我正在使用Java 1.8。 我收到以下错误 我无法确定Spark API是否已更改或其他原因。请帮忙。谢谢。 问题答案: 在2.0中,返回而不是。试试这个:

  • 在我的项目中,当我在控制器中添加异常处理程序方法时,它不起作用。但是如果我将此代码移到具有相同Spring版本的演示项目中,missingParamterHandler方法可以很好地工作。有人能帮我处理这个问题吗?

  • 因此,我在一个控制器中有一个非常简单的代码片段,在这个代码片段中,我使用从外部文件中获取数据,它工作得很好!但是当我使用时,我会在控制台中得到一个