English 中文(简体)
Maven提供了范围并提供了剪辑时间。
原标题:Maven provided scope and eclipse runtime classpath

I ve got a problem with my eclipse classpath with the m2e plugin. I have a project which depends on other projects in my workspace. I ve added these dependencies as maven dependencies with scope provided. I expect the scope to do the following: Provide the dependencies for compilation but exclude them for the runtime classpath. Because at runtime, these classes should be loaded from jars inside a folder.

But the eclipse classpath includes every single dependency I ve provided in the project pom. Eclipse seems to ignore the provided scope. Is there any way to exclude those from runtime classpath?

关于

最佳回答

m2e正在适当开展工作。 我认为你误解了常年的含义。 你的项目实际上取决于汇编和运行时间的其他项目,而当你与Maven一起建设时,管理局将反映这一点。 只有当你计划把项目部署到例如提供受扶养人本身的应用软件服务器时,你才会使用所提供的范围。

问题回答

如果您希望“提供汇编资料,但被排除在正常班次之外”的话,你需要使用“提供的”扶养 cop。 (a Maven术语)而不是“复合”范围,Maven因违约而使用。

i 面临同样的问题,即使用maven-war-plugin ver。 2.3 问题至少是mvn Pack的指挥。

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.3</version>

            <configuration>
                <webxml>WebContent/WEB-INF/web.xml</webxml>
                <packagingExcludes>jsp-api-6.0.36.jar,el-api-6.0.36.jar,servlet-api-6.0.36.jar</packagingExcludes>              

            </configuration>
        </plugin>




相关问题
In Eclipse, why doesn t "Show In" appear for non-Java files?

If I have a *java file open, I can right click on the source, scroll down to "Show In (Alt-Shift-W)", and select Navigator. If I have an *xml, *jsp, or pretty much anything besides a Java source ...

Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable s value. Instead, hover behaves as if I were in normal Java perspective: alt text http://...

Eclipse smart quotes - like in Textmate

Happy Friday — Does anyone know if eclipse has the notion of smart quotes like Textmate. The way it works is to select some words and quote them by simply hitting the " key? I m a newbie here so be ...

Indentation guide for the eclipse editor

Is there a setting or plugin for eclipse that can show indentation guides in the editor? Something like the Codekana plugin for visual studio (not so fancy is also OK). Important that it works with ...

Adding jar from Eclipse plugin runtime tab

I want to add .jar files for plugin from the Runtime tab of manifest file. When I use the Add... button, I can see only sub-directories of the plugin project. So if I want to add same .jar file to ...

How to copy multiple projects into single folder in eclipse

I have two projects, Project1 and Project2. Now i want to copy this projects into eclipse workspace but i want these projects to be in a single folder like below. Eclipse Workspace -> Project -> ...

Java: Finding out what is using all the memory

I have a java application that runs out of memory, but I have no idea which code is allocating the memory. Is there an application with which I can check this? I use Eclipse.

热门标签