使用Maven排除intellij想法中的文件夹 [英] Exclude folder in intellij idea using Maven

查看:222
本文介绍了使用Maven排除intellij想法中的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用maven来管理我们的想法项目,但是我在排除想法项目中的目录时遇到了问题。



使用想法,我会去项目设置|模块|来源并选择我想要排除的文件夹,然后单击排除按钮。从pom加载项目时,会自动排除目标。我也想排除一个日志文件夹。



在maven我正在使用一个构思maven插件,它说我可以排除文件夹。我正在使用此代码,但它似乎不起作用:

 < plugin> 
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-idea-plugin< / artifactId>
< version> 2.3-atlassian-1< / version>
< configuration>
< downloadSources> true< / downloadSources>
< downloadJavadocs> true< / downloadJavadocs>
< exclude>
$ {project.basedir} / logs
< / exclude>
< / configuration>
< / plugin>

我尝试了不同的格式以及放入完全限定的路径(作为测试)但是似乎没有什么能从我的想法项目中排除日志目录。



任何关于如何使这个工作的想法?



<谢谢,尼克。

解决方案

我刚刚做了一个小测试,并使用以下代码片段:

 < plugin> 
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-idea-plugin< / artifactId>
< configuration>
< exclude> test-output,.clover,logs< / exclude>
< / configuration>
< / plugin>

生成的 .iml 文件包含以下内容条目:

 < excludeFolder url =file://$MODULE_DIR$/.clover/> 
< excludeFolder url =file:// $ MODULE_DIR $ / logs/>
< excludeFolder url =file:// $ MODULE_DIR $ / target/>
< excludeFolder url =file:// $ MODULE_DIR $ / test-output/>

据我所知,预期结果。



你有不同的东西吗?你还期待其他什么吗?


We are using maven to manage our idea projects but I'm having a problem excluding a directory from the idea project.

Using idea, I would just go to Project Settings | Modules | Sources and select the folder I wanted to exclude and click on the "Excluded" button. When loading the project from the pom, target is excluded automatically. I want to exclude a logs folder as well.

In maven I'm using an idea maven plugin and it says I can exclude folders. I'm using this code but it doesn't seem to work:

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-idea-plugin</artifactId>
            <version>2.3-atlassian-1</version>
            <configuration>
                <downloadSources>true</downloadSources>
                <downloadJavadocs>true</downloadJavadocs>
                <exclude>
                    ${project.basedir}/logs
                </exclude>
            </configuration>
        </plugin>

I've tried different formats as well as putting in the fully qualified path (as a test) but nothing seems to exclude the logs directory from my idea project.

Anyone any ideas on how to get this working?

Thanks, Nick.

解决方案

I just did a small test and, with the following snippet:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-idea-plugin</artifactId>
  <configuration>
    <exclude>test-output,.clover,logs</exclude>
  </configuration>
</plugin>

The generated .iml file contains the following entries:

  <excludeFolder url="file://$MODULE_DIR$/.clover"/>
  <excludeFolder url="file://$MODULE_DIR$/logs"/>
  <excludeFolder url="file://$MODULE_DIR$/target"/>
  <excludeFolder url="file://$MODULE_DIR$/test-output"/>

Which is to my knowledge the expected result.

Do you get something different? Are you expecting somehting else?

这篇关于使用Maven排除intellij想法中的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆