Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/362.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
Java 如何从maven构建中排除节点_模块_Java_Maven - Fatal编程技术网

Java 如何从maven构建中排除节点_模块

Java 如何从maven构建中排除节点_模块,java,maven,Java,Maven,我在项目中使用Gulp和Node.js。我在src/main/resources中有一个node\u modules文件夹,每次运行mvn install它都会将9000多个文件复制到目标文件夹 我不要这个!如何排除节点\u模块文件夹 我试过这个: <excludes> <exclude>**/src/main/resources/node_modules/*</exclude> </excludes> **/src/main/reso

我在项目中使用Gulp和Node.js。我在
src/main/resources
中有一个
node\u modules
文件夹,每次运行
mvn install
它都会将9000多个文件复制到目标文件夹

我不要这个!如何排除
节点\u模块
文件夹

我试过这个:

<excludes>
    <exclude>**/src/main/resources/node_modules/*</exclude>
</excludes>

**/src/main/resources/node_模块/*
还有这个

<excludes>
    <exclude>node_modules/**</exclude>
</excludes>

节点单元/**
maven编译器插件的内部配置标记。但这不起作用

有人有解决办法吗

这是我的pom的构建部分

<build>
    <plugins>
        <plugin>
            <groupId>com.atlassian.maven.plugins</groupId>
            <artifactId>maven-jira-plugin</artifactId>
            <version>${amps.version}</version>
            <extensions>true</extensions>
            <configuration>
                <productVersion>${jira.version}</productVersion>
                <productDataVersion>${jira.version}</productDataVersion>
                <applications>
                    <application>
                        <applicationKey>jira-software</applicationKey>
                        <version>${jira.software.application.version}</version>
                    </application>
                </applications>
                <!-- Uncomment to install TestKit backdoor in JIRA. -->
                <!--
                <pluginArtifacts>
                    <pluginArtifact>
                        <groupId>com.atlassian.jira.tests</groupId>
                        <artifactId>jira-testkit-plugin</artifactId>
                        <version>${testkit.version}</version>
                    </pluginArtifact>
                </pluginArtifacts>
                -->
                <pluginArtifacts>
                    <pluginArtifact>
                        <groupId>com.atlassian.labs.plugins</groupId>
                        <artifactId>quickreload</artifactId>
                        <version>1.30.5</version>
                    </pluginArtifact>
                </pluginArtifacts>
                <compressResources>false</compressResources>
                <enableQuickReload>true</enableQuickReload>
                <enableFastdev>false</enableFastdev>
                <allowGoogleTracking>false</allowGoogleTracking>
                <productDataPath>./generated-test-resources.zip
                </productDataPath>
                <!-- See here for an explanation of default instructions: -->
                <!-- https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins -->
                <instructions>
                    <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>

                    <!-- Add package to export here -->
                    <Export-Package>
                        de.cschulc.jira.plugin.api,
                    </Export-Package>

                    <!-- Add package import here -->
                    <Import-Package>
                        org.springframework.osgi.*;resolution:="optional",
                        org.eclipse.gemini.blueprint.*;resolution:="optional",
                        *;version="0";resolution:=optional,
                        *
                    </Import-Package>

                    <!-- Ensure plugin is spring powered -->
                    <Spring-Context>*</Spring-Context>
                </instructions>

            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.7.0</version>
            <configuration>
                <source>${maven.compiler.source}</source>
                <target>${maven.compiler.target}</target>
                <excludes>
                    <exclude>**/src/main/resources/node_modules/*</exclude>
                </excludes>
            </configuration>

        </plugin>

        <plugin>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
            <version>${atlassian.spring.scanner.version}</version>
            <executions>
                <execution>
                    <goals>
                        <goal>atlassian-spring-scanner</goal>
                    </goals>
                    <phase>process-classes</phase>
                </execution>
            </executions>
            <configuration>
                <scannedDependencies>
                    <dependency>
                        <groupId>com.atlassian.plugin</groupId>
                        <artifactId>atlassian-spring-scanner-external-jar</artifactId>
                    </dependency>
                </scannedDependencies>
                <verbose>false</verbose>
            </configuration>
        </plugin>
    </plugins>
</build>

com.atlassian.maven.plugins
maven jira插件
${amps.version}
真的
${jira.version}
${jira.version}
jira软件
${jira.software.application.version}
com.atlassian.labs.plugins
快速重新加载
1.30.5
假的
真的
假的
假的
./generated-test-resources.zip
${atlassian.plugin.key}
de.cschulc.jira.plugin.api,
org.springframework.osgi.*;分辨率:=“可选”,
org.eclipse.gemini.blueprint.*;分辨率:=“可选”,
*;version=“0”;分辨率:=可选,
*
*
org.apache.maven.plugins
maven编译器插件
3.7.0
${maven.compiler.source}
${maven.compiler.target}
**/src/main/resources/node_模块/*
com.atlassian.plugin
atlassian spring scanner maven插件
${atlassian.spring.scanner.version}
大西洋弹簧扫描仪
进程类
com.atlassian.plugin
atlassian弹簧扫描仪外部震击器
假的
改为尝试:

<exclude>node_modules/**</exclude>

我建议你用一种不同的方法,对我来说很好

  • 将节点_模块从
    myproject/src/main/resources
    移动到
    myproject
    :当我想在本地安装模块时,我更自然地从项目的根文件夹运行npm,因为它是我的工作目录,请参阅
  • 在pom中使用此插件:,它与node和npm配合使用非常好,可以让您使用许多javascript自动化工具。它有一个很好的文档使它工作
  • 使用gulp或grunt仅将类路径中所需的javascript资源从
    myproject/node_modules
    移动到
    myproject/target/…

  • 我有这个问题,由

    <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-war-plugin</artifactId>
         <version>3.2.3</version>
         <configuration>
             <warSourceExcludes>node_modules/**,build/**,config/**,src/**</warSourceExcludes>
         </configuration>
    </plugin>
    
    
    org.apache.maven.plugins
    maven战争插件
    3.2.3
    节点\模块/**,构建/**,配置/**,src/**
    
    Post your pom.xml可能是重复的是我做了这个解决方案,因为我没有心情搜索一个解决方案来排除node_modules文件夹。
    <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-war-plugin</artifactId>
         <version>3.2.3</version>
         <configuration>
             <warSourceExcludes>node_modules/**,build/**,config/**,src/**</warSourceExcludes>
         </configuration>
    </plugin>