Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven Grails尝试将zip文件作为插件加载_Maven_Grails_Zip_Pom.xml_Maven Dependency Plugin - Fatal编程技术网

Maven Grails尝试将zip文件作为插件加载

Maven Grails尝试将zip文件作为插件加载,maven,grails,zip,pom.xml,maven-dependency-plugin,Maven,Grails,Zip,Pom.xml,Maven Dependency Plugin,我将Grails2.1.1与Maven一起使用。在我的pom.xml中,我使用maven依赖插件,它从本地maven存储库下载一些通用java script.zip文件,并将其解压缩到web应用程序中 这很好,但是Grails失败了,并显示以下消息: |Packaging Grails application Error | Zip C:\Users\andreyk\.m2\repository\com\company\ui\common-java-script\1.3.0.0\common-j

我将Grails2.1.1与Maven一起使用。在我的pom.xml中,我使用maven依赖插件,它从本地maven存储库下载一些通用java script.zip文件,并将其解压缩到web应用程序中

这很好,但是Grails失败了,并显示以下消息:

|Packaging Grails application
Error |
Zip C:\Users\andreyk\.m2\repository\com\company\ui\common-java-script\1.3.0.0\common-java-script-1.3.0.0.zip is not a valid plugin
我的理解是Grails将common-java-script-1.3.0.0.zip解释为它的插件,但无法加载它。 如何让Grails忽略common-java-script-1.3.0.0.zip?有没有更好的办法来处理这种情况

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>com.company</groupId>
    <artifactId>pre-authorization</artifactId>
    <packaging>grails-app</packaging>
    <version>0.1</version>
    <name>pre-authorization</name>
    <description>pre-authorization</description>

    <parent>
        <groupId>com</groupId>
        <artifactId>company</artifactId>
        <version>1.0</version>
    </parent>

    <properties>
        <grails.version>2.1.1</grails.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>com.company.ui</groupId>
            <artifactId>common-java-script</artifactId>
            <version>1.3.0.0</version>
            <type>zip</type>
        </dependency>

        <dependency>
            <groupId>org.grails</groupId>
            <artifactId>grails-dependencies</artifactId>
            <version>${grails.version}</version>
            <type>pom</type>
        </dependency>

        <dependency>
            <groupId>org.grails</groupId>
            <artifactId>grails-plugin-testing</artifactId>
            <version>${grails.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.grails.plugins</groupId>
            <artifactId>tomcat</artifactId>
            <version>${grails.version}</version>
            <scope>provided</scope>
            <type>zip</type>
        </dependency>


        <dependency>
            <groupId>org.grails.plugins</groupId>
            <artifactId>cache</artifactId>
            <version>1.0.0</version>
            <scope>compile</scope>
            <type>zip</type>
        </dependency>


        <dependency>
            <groupId>org.grails.plugins</groupId>
            <artifactId>hibernate</artifactId>
            <version>2.1.1</version>
            <scope>runtime</scope>
            <type>zip</type>
        </dependency>


        <dependency>
            <groupId>org.grails.plugins</groupId>
            <artifactId>resources</artifactId>
            <version>1.1.6</version>
            <scope>runtime</scope>
            <type>zip</type>
        </dependency>


        <dependency>
            <groupId>org.grails.plugins</groupId>
            <artifactId>jquery</artifactId>
            <version>1.8.0</version>
            <scope>runtime</scope>
            <type>zip</type>
        </dependency>


        <dependency>
            <groupId>org.grails.plugins</groupId>
            <artifactId>database-migration</artifactId>
            <version>1.1</version>
            <scope>runtime</scope>
            <type>zip</type>
        </dependency>


        <dependency>
            <groupId>org.grails.plugins</groupId>
            <artifactId>webxml</artifactId>
            <version>1.4.1</version>
            <scope>provided</scope>
            <type>zip</type>
        </dependency>

    </dependencies>

    <build>
        <pluginManagement />

        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.5</version>
                <executions>
                    <execution>
                        <id>unpack-owner</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.company.ui</groupId>
                                    <artifactId>common-java-script</artifactId>
                                    <version>1.3.0.0</version>
                                    <excludes>common/bootstrap.js</excludes>
                                    <type>zip</type>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>web-app</outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>true</overWriteSnapshots>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Disables the Maven surefire plugin for Grails applications, as we have our own test runner -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>surefire-it</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>plugins</directory>
                            <includes>
                                <include>**/*</include>
                            </includes>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.grails</groupId>
                <artifactId>grails-maven-plugin</artifactId>
                <version>${grails.version}</version>
                <configuration>
                    <!-- Whether for Fork a JVM to run Grails commands -->
                    <fork>true</fork>
                </configuration>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>grails</id>
            <name>grails</name>
            <url>http://repo.grails.org/grails/core</url>
        </repository>
        <repository>
            <id>grails-plugins</id>
            <name>grails-plugins</name>
            <url>http://repo.grails.org/grails/plugins</url>
        </repository>
    </repositories>

    <profiles>
        <profile>
            <id>tools</id>
            <activation>
                <property>
                    <name>java.vendor</name>
                    <value>Sun Microsystems Inc.</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.sun</groupId>
                    <artifactId>tools</artifactId>
                    <version>${java.version}</version>
                    <scope>system</scope>
                    <systemPath>${java.home}/../lib/tools.jar</systemPath>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>

4.0.0
com公司
预授权
grails应用程序
0.1
预授权
预授权
通用域名格式
公司
1
2.1.1
com.company.ui
通用java脚本
1.3.0.0
拉链
org.grails
grails依赖项
${grails.version}
聚甲醛
org.grails
grails插件测试
${grails.version}
测试
org.grails.plugins
雄猫
${grails.version}
假如
拉链
org.grails.plugins
隐藏物
1.0.0
编译
拉链
org.grails.plugins
冬眠
2.1.1
运行时
拉链
org.grails.plugins
资源
1.1.6
运行时
拉链
org.grails.plugins
jquery
1.8.0
运行时
拉链
org.grails.plugins
数据库迁移
1.1
运行时
拉链
org.grails.plugins
webxml
1.4.1
假如
拉链
org.apache.maven.plugins
maven依赖插件
2.5
拆包人
过程资源
打开
com.company.ui
通用java脚本
1.3.0.0
common/bootstrap.js
拉链
网络应用
假的
真的
org.apache.maven.plugins
maven surefire插件
真的
当然可以
集成测试
测试
假的
org.apache.maven.plugins
maven清洁插件
2.4.1
插件
**/*
假的
org.grails
GrailsMaven插件
${grails.version}
真的
真的
圣杯
圣杯
http://repo.grails.org/grails/core
grails插件
grails插件
http://repo.grails.org/grails/plugins
工具
java.vendor
太阳微系统公司。
com.sun
工具
${java.version}
系统
${java.home}/./lib/tools.jar

由于一些愚蠢的原因,比如一天结束、缺少糖等,我在pom.xml中有一个条目,这显然导致了一个问题:

<dependency>
    <groupId>com.company.ui</groupId>
    <artifactId>common-java-script</artifactId>
    <version>1.3.0.0</version>
    <type>zip</type>
</dependency>

com.company.ui
通用java脚本
1.3.0.0
拉链
我把它取下来后,一切都很好