Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7516169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:02:58+00:00 2026-05-30T01:02:58+00:00

I hope I’m explaining this as accurately as possible, and I want to know

  • 0

I hope I’m explaining this as accurately as possible, and I want to know if I set up the maven dependencies correctly, or if there’s a better way to do it.

Most of my development team’s projects rely on a home-grown jar that is deployed at server class loader. The reason for this jar to reside at this level is to the ease of updating the jar at one place without repackaging each project that’s using it, assuming changes made to it are backward-compatible.

I develop my web apps against Jetty in my local development. So, in order for the web apps to work locally, I set up the dependencies this way:-

<dependencies>
    <!-- Configuring external jar dependency -->
    <dependency>
        <groupId>com.test.app</groupId>
        <artifactId>app-jar</artifactId>
        <version>1.0</version>
        <scope>system</scope>
        <systemPath>${env.EXTERNAL_JAR}</systemPath>
    </dependency>

    ...
</dependencies>

<build>
    <plugins>
        <!-- Configuring Jetty -->
        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>maven-jetty-plugin</artifactId>
            <version>6.1.26</version>
            <configuration>
                <contextPath>/${project.parent.artifactId}</contextPath>
                <jettyEnvXml>${env.JETTY_ENV_XML}</jettyEnvXml>
                <scanIntervalSeconds>1</scanIntervalSeconds>
                <connectors>
                    <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                        <port>7777</port>
                    </connector>
                </connectors>
                <webAppConfig>
                    <extraClasspath>${env.EXTERNAL_JAR}</extraClasspath>
                </webAppConfig>
            </configuration>
        </plugin>

        ...
    </plugins>
</build>

In this approach, I set up an environment variable that points to the external jar path, and reference it in my pom.xml as ${env.EXTERNAL_JAR}.

After doing some reading, it seems like using “system” scope is considered a bad practice. So, I installed this external jar in Nexus and change the scope to “provided”:-

<dependency>
    <groupId>com.test.app</groupId>
    <artifactId>app-jar</artifactId>
    <version>1.0</version>
    <scope>provided</scope>
</dependency>

This allows me to compile my project properly, but I’m not sure if it is even possible for me to get rid of the “EXTERNAL_JAR” environment variable completely because it’s still needed by Jetty for the runtime to work properly. My take is using “provided” scope is a little tedious and more work, because I now need to remember to update the jar in Nexus when it is modified AND I still need to update the jar located at the path pointed by the environment variable.

Is there a way for me to expose the external jar to Jetty through maven dependencies, yet not being packaged into the project when the war file is built?

What are you advice on this? Should I just stick with “system” scope so that I just need to update the jar at one place, or should I use “provided” scope? Or if there’s even a better way to do this?

Thanks much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:03:01+00:00Added an answer on May 30, 2026 at 1:03 am

    You should be able to add dependencies to the jetty plugin. And then I have the provided scope for the project itself.

    http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin

    as in

    <project>
    ... 
          <plugin> 
            <groupId>org.mortbay.jetty</groupId> 
            <artifactId>maven-jetty-plugin</artifactId> 
            <configuration> 
              <systemProperties> 
                <systemProperty> 
                  <name>logback.configurationFile</name> 
                  <value>./src/etc/logback.xml</value> 
                </systemProperty> 
              </systemProperties> 
            </configuration> 
            <dependencies>
              <dependency> 
                <groupId>ch.qos.logback</groupId> 
                <artifactId>logback-classic</artifactId> 
                <version>0.9.15</version> 
              </dependency> 
            </dependencies> 
          </plugin>
    ...
    <project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hope I'm asking this correctly: I have a project Projects.Client I have my class
Hope this is possible- Have a table like so: Car_ID Brand Model Year ----------------------------------
Hope it is possible: I have a delegate like this: delegate bool X(); I
Hope that someone out there can help with this! I'll give an example based
Hope my title is not too confusing. Please let me know if there is
Hope this question wasn't asked before. Does anyone know the character limit for domain
Hope this question is not stupid since I am an amateur web designer. I
hope someone can answer this. Here is some sample code. namespace std { #ifdef
hope all is swell! I was hoping I had cracked this problem but it
Hope someone could help me with this: I would like to have a column

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.