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 7187883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:56:43+00:00 2026-05-28T18:56:43+00:00

I am having problems compiling some Scala with Maven or Eclipse where I try

  • 0

I am having problems compiling some Scala with Maven or Eclipse where I try to import a class from a Java jar which contains both a namespace and class of the same name.
I can compile with scalac, however.

E.g. the Java project (jar) contains:

src/foo/bar.java

src/foo/bar/some_resource.txt

-> foobar.jar

Scala project references foobar.jar

Foobartest.scala:

import foo.bar

class foobartest {

}

The compiler complains with:

package foo contains object and package with same name: bar 
one of them needs to be removed from classpath

Using Maven 3.0.03/Eclipse 3.7.1 with Scala 2.9.0.1 (and maven-scala-plugin).

The jar which I am having problems with is jenkins-core-1.399.jar – it definitely contains several instances where there is a namespace and object of the same name.
I am attempting to write a Jenkins plugin in Scala (I could do this in Java but would prefer scala since all of our libraries are in scala), which is dependent on using Maven –
https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial.

  • 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-28T18:56:44+00:00Added an answer on May 28, 2026 at 6:56 pm

    That kind of limitation was outlined in SI-4695: package object misbehaves in the presence of classfiles.

    As suggested in SI-2089 (naming restriction makes some jars unusable), you could try and use the “resolve-term-conflict“, as implemented in changeset 25145:

    Added a -Y option to resolve namespace collisions between package and object.
    It’s a blunt instrument: if people have lots of these conflicts they need to resolve in individually nuanced fashion, they’ll probably remain out of luck.

    val termConflict  = ChoiceSetting     ("-Yresolve-term-conflict", "strategy", "Resolve term conflicts", 113 List("package", "object", "error"), "error")
    
    // Some jars (often, obfuscated ones) include a package and
    // object with the same name. Rather than render them unusable,
    // offer a setting to resolve the conflict one way or the other.
    // This was motivated by the desire to use YourKit probes, which
    // require `yjp.jar` at runtime. See SI-2089.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm following the kernel tutorial from here im having problems compiling my files. i
I'm having some problems (as some of you will see from another question I
I am having some problems comparing the elements in different cell arrays. The context
I'm having problems compiling the following program. I'm using gcc -framework Foundation inherit8.1m and
I'm not an experienced C++ programmer and I'm having problems compiling. I've got a
I'm having a problem compiling an application which uses Core-Plot in debug mode. It
I am having problems compiling the following snippet int temp; vector<int> origins; vector<string> originTokens
I've been having problems on compiling Fluidsynth (1.0.9) for Android JNI. After reading into
I'm having problems with compiling a project I'm working on. Everything else works just
I am trying to install mysql on snow leopard and having some problems. I

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.