Maven:mvn包失败

时间:2013-10-02 09:19:29

标签: java maven pom.xml maven-assembly-plugin playn

我正在尝试使用“mvn package”命令从maven项目创建可执行的.jar文件。它已经工作了一段时间,但现在,在调试模式下运行命令后,我得到了这个:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.074s
[INFO] Finished at: Wed Oct 02 11:25:05 CEST 2013
[INFO] Final Memory: 17M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.
4:single (make-assembly) on project shootingmovies-java: Execution make-assembly
 of goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single failed. Illeg
alArgumentException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.apache.maven.plugins:maven-assembly-plugin:2.4:single (make-assembly) on proj
ect shootingmovies-java: Execution make-assembly of goal org.apache.maven.plugin
s:maven-assembly-plugin:2.4:single failed.
        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.buildProje
ct(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.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:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution make-asse
mbly of goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single failed.
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:110)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
        ... 19 more
Caused by: java.lang.IllegalArgumentException
        at sun.net.www.ParseUtil.decode(ParseUtil.java:202)
        at java.net.JarURLConnection.parseSpecs(JarURLConnection.java:185)
        at java.net.JarURLConnection.<init>(JarURLConnection.java:162)
        at sun.net.www.protocol.jar.JarURLConnection.<init>(JarURLConnection.jav
a:81)
        at sun.net.www.protocol.jar.Handler.openConnection(Handler.java:41)
        at java.net.URL.openConnection(URL.java:971)
        at java.net.URL.openStream(URL.java:1037)
        at org.codehaus.plexus.components.io.resources.PlexusIoURLResource.getCo
ntents(PlexusIoURLResource.java:34)
        at org.codehaus.plexus.archiver.ArchiveEntry.getInputStream(ArchiveEntry
.java:106)
        at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.zipFile(Abstract
ZipArchiver.java:590)
        at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.addResources(Abs
tractZipArchiver.java:398)
        at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.createArchiveMai
n(AbstractZipArchiver.java:323)
        at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.execute(Abstract
ZipArchiver.java:222)
        at org.codehaus.plexus.archiver.AbstractArchiver.createArchive(AbstractA
rchiver.java:910)
        at org.apache.maven.plugin.assembly.archive.archiver.AssemblyProxyArchiv
er.createArchive(AssemblyProxyArchiver.java:512)
        at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.crea
teArchive(DefaultAssemblyArchiver.java:186)
        at org.apache.maven.plugin.assembly.mojos.AbstractAssemblyMojo.execute(A
bstractAssemblyMojo.java:436)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:101)
        ... 20 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutio
nException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :shootingmovies-java

我不知道在哪里查找错误,因为我没有更改实际代码之外的任何内容,而且似乎与此无关,因为我可以从终端执行它就好了。 我猜它是某种设置或pom.xml文件中的某些东西,但我不想只是去修改那里的东西而不知道我在寻找什么。 欢迎任何帮助,谢谢。

希望它可以提供帮助,这是我的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>
  <parent>
    <groupId>com.googlecode.shootingmovies</groupId>
    <artifactId>shootingmovies</artifactId>
    <version>1.0</version>
  </parent>

  <artifactId>shootingmovies-java</artifactId>
  <packaging>jar</packaging>
  <name>Hub Java</name>

  <properties>
    <mainClass>SMpackage.java.HubJava</mainClass>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.googlecode.shootingmovies</groupId>
      <artifactId>shootingmovies-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>com.googlecode.shootingmovies</groupId>
      <artifactId>shootingmovies-assets</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>com.googlecode.playn</groupId>
      <artifactId>playn-java</artifactId>
      <version>${playn.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- builds a standalone jar file during 'mvn package' -->
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
          <archive>
            <manifest>
              <mainClass>${mainClass}</mainClass>
            </manifest>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>java</id>
      <build>
        <plugins>
          <!-- allows testing of Java backend via: mvn test -Pjava -->
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <executions>
              <execution>
                <phase>test</phase>
                <goals>
                  <goal>java</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <mainClass>${mainClass}</mainClass>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>

0 个答案:

没有答案