How to use a maven package as both a dependency and a plugin

I am putting together a new project using Maven and JUnit. I am using the t7 plugin to run the application under tomcat after maven has compiled and run tests. I didn't have any problems until I wanted to set up the javaURLContextFactory in a JUnit test. The javaURLContextFactory is in the t7 plugin, but not in any of the dependencies for the project. With the plugin only defined as a plugin, the JUnit test fails, as it can't find the javaURLContextFactory class. If add the plugin as a dependency only, The JUnit test works, bu then it can't find the plugin when I want to run or debug. If I define it in both, I get bizarre errors related to parsing the web.xml.

Here is my current pom.xml:

<project xmlns="" xmlns:xsi=""
    <name>distribute Maven Webapp</name>

Is there any way to reference the classes in the plugin as a dependency, or reference the dependency as a plugin? Is there some other method of fixing this?


Found a solution after talking to a co-worker.

By including the plugin as a dependency, I know it's bad, and setting the scope to provided, it was available for the JUnit test, but not included in the war when it was deployed using the t7 plugin. Then the unit tests were able to run, with the javaURLContextFactory and it still deployed properly.

Need Your Help

Is there right way to store resolved promises?

javascript node.js promise bluebird

Right now almost every node package has callback api. What if I'm writing wrapper around it, ORM for instance:

Attempting to use Boost.Filesystem however it doesn't seem to link?

c++ boost filesystems boost-filesystem

I'm using OS X 10.7.3. I've been playing with the boost headers for a while now and i wanted to move onto using the Boost.Filesystem lib however it keeps throwing this message at me:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.