Results 1 to 10 of 10
Like Tree1Likes
  • 1 Post By gimbal2

Thread: Is this a Maven issue?

  1. #1
    edjm1971 is offline Member
    Join Date
    Nov 2014
    Posts
    6
    Rep Power
    0

    Angry Is this a Maven issue?

    I am as new as new can be to Maven.
    IDE: Eclipse

    I am on a Java project where everything seems to be a project even though everything is nested down in a folder under the same parent folder.

    I have project A and B
    I'm making calls to get a JSONObject from the other project, so

    I have something along the lines of
    PROJECT B FILE
    com.atlassian.jira.util.json.JSONObject myJo = A.getJo();

    PROJECT A FILE
    getJo(){
    com.atlassian.jira.util.json.JSONObject responseJo = new JSONObject();
    }

    So, how in the heck can the compiler possibly be telling me that the types are "incompatible types"?

    I first used a simple import at the top of the page
    Then 2x checked to make sure that both were the same.
    Then changed the declaration itself to what you see above to be crystal clear that I am pointing to the same JSONObject class but no matter what I keep getting the error "incompatible types"?

    Really could use some assistance on where to look.
    I've never had so many problems in my life until trying to use Maven.

    Note: The eclipse environment is totally FUBAR as well. I did what I was told before by making a new workspace. Import existing maven project.
    But everything is red, imports are not found. Ctrl + Click does not function.
    WTH

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Is this a Maven issue?

    What versions of that Jira jar file are you importing?
    My first guess is they are different.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Is this a Maven issue?

    Surely:

    Java Code:
    com.atlassian.jira.util.json.JSONObject responseJo = new com.atlassian.jira.util.json.JSONObject();
    works?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Is this a Maven issue?

    Oh.
    Missed the fully qualified name!
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    edjm1971 is offline Member
    Join Date
    Nov 2014
    Posts
    6
    Rep Power
    0

    Default Re: Is this a Maven issue?

    That works fine of course setting of a variable in a class.
    The issue that I have is that using that when A asks for the value from B it tells me that it is not compatible and the build fails. I would rather rip out all of the Maven stuff at this point and just stick with a standard ANT build but that's only because ANT I'm familiar with and have no support at the office on Maven which I know nothing of. But unfortunately that takes even more time that I don't have. Literally on this project 90% of our time is spent on troubleshooting the development environment in order to try and get any coding done.
    ----------------
    Inside of class A
    com.atlassian.jira.util.json.JSONObject myJO = classB.getJSONObject();

    ----------------
    Inside of class B
    public com.atlassian.jira.util.json.JSONObject getJSONObject(){
    com.atlassian.jira.util.json.JSONObject responseJo = new com.atlassian.jira.util.json.JSONObject();
    return responseJO;
    }


    Again the above during the Maven build will fail saying that the they are incompatible.
    Last edited by edjm1971; 11-12-2014 at 03:52 PM. Reason: formatting

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Is this a Maven issue?

    Can you post the full error message you're getting?
    Do the two projects have different versions of the jar (as I asked above)?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    edjm1971 is offline Member
    Join Date
    Nov 2014
    Posts
    6
    Rep Power
    0

    Default Re: Is this a Maven issue?

    @Tolls
    I am not in the office today but really the error is just one line that outputs in the cmd window when running the Maven build and it says something along the lines of "incompatible types".

    As for the version of them, I had to the best of my guessing set the build in Eclipse by right clicking on the project then under Maven add library (something like this) and typed in JSON to which it gave the the atlassian json package I think like 8.12 for both.
    This is part of the issue because I'm guessing what Maven is doing and am not able to get any assistance at work because nobody appears to know what to do with Maven because the people who knew anything about it left the project a long time ago.

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Is this a Maven issue?

    OK.
    Not sure about in Eclipse, but I would look into upping the logging for Maven to find out exactly what the problem is.
    The Apache Maven site will give you all the switches.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    edjm1971 is offline Member
    Join Date
    Nov 2014
    Posts
    6
    Rep Power
    0

    Default Re: Is this a Maven issue?

    Can you tell me if there is a way as well to have Maven dump the build logs into a file because too much stuff goes by that I am not able to view in the cmd window?

    If you know of the actual command would you please post that here too for me.
    Thank you.

  10. #10
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Is this a Maven issue?

    A "maven build" is not only compilation, it is the entire build process. Part of that process may also be the invocation of unit tests. So if a unit test fails (which is a runtime failure, not a compilation failure), you'll still get a "build failed" error. Perhaps, and I hope, the build is failing at that point as that means it really is a "simple" classpath-hell issue.

    Nothing Maven specific, for all command line / shell invocation stuff you can send the output to a text file by redirecting it:

    Java Code:
    mvn clean install > build_output.txt
    edjm1971 likes this.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Replies: 0
    Last Post: 09-23-2014, 02:58 PM
  2. Issue while creating new Maven project in eclipse
    By csinha032414 in forum Apache Maven
    Replies: 3
    Last Post: 09-19-2014, 03:18 PM
  3. Replies: 3
    Last Post: 08-05-2014, 01:35 PM
  4. Maven Deloy Issue
    By nareshbabuy4u@gmail.com in forum Apache Maven
    Replies: 1
    Last Post: 02-06-2014, 08:16 AM
  5. Replies: 0
    Last Post: 12-17-2012, 01:32 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •