Maven CycleException











up vote
2
down vote

favorite
1












I am currently making a library for my upcoming spigot plugins. But you won't require any knowledge of that since this is more dependent on maven issues



So firstly I'd like to give the source



I have multiple modules: Library, v1_13_R1, v1_13_R2, the reason for multiple v1_13_R etc. is because Maven won't allow you to implement multiple versions of the same dependency. And its crucial for the functions of these modules to have the right version as the packages have the version names in them. EDIT 1 I've seen that this may sound confusing so: The reason why its possible to have multiple of the same library in one jar(Not module) is possible because my system won't initiate the class containing imports that aren't provided as I first detect which version is used. This way I can make it multi-version. I hope this clears up some of the confusing regarding this.



So if I clean package from root then It will create 3 jars, but none of them contains all 3 modules, which is what I need. And if I make the version dependent modules a dependency in my Library module, then I'll get a CycleException.



1) any idea on how to fix this?


or optionally:


2) is there any better project structure possible?



Any help would be really appreciated, thanks in advance



EDIT I still need a good answer as its frustrating me at the moment since nothing works. So if you have any knowledge on how to make such a project structure work please tell me.










share|improve this question
























  • It does not make sense having different versions of the same library on a classpath. This is basic Java and nothing to do with Maven. Furthermore I've seen a package with <type>javadoc</type> which does not exist in Maven. But what exists would be a javadoc package which has a classifier <classifier>javadoc</classifier>...and why is the javadoc part defined as <scope>provided</scope> which does not make sense..?
    – khmarbaise
    Nov 11 at 8:06










  • It does, as NMS(The part I am trying do get right) updates its package name with each version for example for v1_13_R1 the package name is: net.minecraft.server.v1_13_R1 and for v1_13_R2 it is: net.minecraft.server.v1_13_R2 and I need to make multiple modules since I can not make one module have multiple versions on the same artifact. Also I have no dependency as type javadoc
    – YourPalJake
    Nov 11 at 11:11










  • So, are you saying that if you identify your modules V1_13_R1 and V1_13_R2 with the same groupId and artifactId, but different version numbers, you cannot get Maven to have Library depend on both of them?
    – moilejter
    Nov 11 at 19:17












  • No the library that those modules use cannot be added as dependency with multiple versions in the same module
    – YourPalJake
    Nov 11 at 20:34















up vote
2
down vote

favorite
1












I am currently making a library for my upcoming spigot plugins. But you won't require any knowledge of that since this is more dependent on maven issues



So firstly I'd like to give the source



I have multiple modules: Library, v1_13_R1, v1_13_R2, the reason for multiple v1_13_R etc. is because Maven won't allow you to implement multiple versions of the same dependency. And its crucial for the functions of these modules to have the right version as the packages have the version names in them. EDIT 1 I've seen that this may sound confusing so: The reason why its possible to have multiple of the same library in one jar(Not module) is possible because my system won't initiate the class containing imports that aren't provided as I first detect which version is used. This way I can make it multi-version. I hope this clears up some of the confusing regarding this.



So if I clean package from root then It will create 3 jars, but none of them contains all 3 modules, which is what I need. And if I make the version dependent modules a dependency in my Library module, then I'll get a CycleException.



1) any idea on how to fix this?


or optionally:


2) is there any better project structure possible?



Any help would be really appreciated, thanks in advance



EDIT I still need a good answer as its frustrating me at the moment since nothing works. So if you have any knowledge on how to make such a project structure work please tell me.










share|improve this question
























  • It does not make sense having different versions of the same library on a classpath. This is basic Java and nothing to do with Maven. Furthermore I've seen a package with <type>javadoc</type> which does not exist in Maven. But what exists would be a javadoc package which has a classifier <classifier>javadoc</classifier>...and why is the javadoc part defined as <scope>provided</scope> which does not make sense..?
    – khmarbaise
    Nov 11 at 8:06










  • It does, as NMS(The part I am trying do get right) updates its package name with each version for example for v1_13_R1 the package name is: net.minecraft.server.v1_13_R1 and for v1_13_R2 it is: net.minecraft.server.v1_13_R2 and I need to make multiple modules since I can not make one module have multiple versions on the same artifact. Also I have no dependency as type javadoc
    – YourPalJake
    Nov 11 at 11:11










  • So, are you saying that if you identify your modules V1_13_R1 and V1_13_R2 with the same groupId and artifactId, but different version numbers, you cannot get Maven to have Library depend on both of them?
    – moilejter
    Nov 11 at 19:17












  • No the library that those modules use cannot be added as dependency with multiple versions in the same module
    – YourPalJake
    Nov 11 at 20:34













up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





I am currently making a library for my upcoming spigot plugins. But you won't require any knowledge of that since this is more dependent on maven issues



So firstly I'd like to give the source



I have multiple modules: Library, v1_13_R1, v1_13_R2, the reason for multiple v1_13_R etc. is because Maven won't allow you to implement multiple versions of the same dependency. And its crucial for the functions of these modules to have the right version as the packages have the version names in them. EDIT 1 I've seen that this may sound confusing so: The reason why its possible to have multiple of the same library in one jar(Not module) is possible because my system won't initiate the class containing imports that aren't provided as I first detect which version is used. This way I can make it multi-version. I hope this clears up some of the confusing regarding this.



So if I clean package from root then It will create 3 jars, but none of them contains all 3 modules, which is what I need. And if I make the version dependent modules a dependency in my Library module, then I'll get a CycleException.



1) any idea on how to fix this?


or optionally:


2) is there any better project structure possible?



Any help would be really appreciated, thanks in advance



EDIT I still need a good answer as its frustrating me at the moment since nothing works. So if you have any knowledge on how to make such a project structure work please tell me.










share|improve this question















I am currently making a library for my upcoming spigot plugins. But you won't require any knowledge of that since this is more dependent on maven issues



So firstly I'd like to give the source



I have multiple modules: Library, v1_13_R1, v1_13_R2, the reason for multiple v1_13_R etc. is because Maven won't allow you to implement multiple versions of the same dependency. And its crucial for the functions of these modules to have the right version as the packages have the version names in them. EDIT 1 I've seen that this may sound confusing so: The reason why its possible to have multiple of the same library in one jar(Not module) is possible because my system won't initiate the class containing imports that aren't provided as I first detect which version is used. This way I can make it multi-version. I hope this clears up some of the confusing regarding this.



So if I clean package from root then It will create 3 jars, but none of them contains all 3 modules, which is what I need. And if I make the version dependent modules a dependency in my Library module, then I'll get a CycleException.



1) any idea on how to fix this?


or optionally:


2) is there any better project structure possible?



Any help would be really appreciated, thanks in advance



EDIT I still need a good answer as its frustrating me at the moment since nothing works. So if you have any knowledge on how to make such a project structure work please tell me.







java maven bukkit






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 18 at 11:43

























asked Nov 10 at 23:15









YourPalJake

116




116












  • It does not make sense having different versions of the same library on a classpath. This is basic Java and nothing to do with Maven. Furthermore I've seen a package with <type>javadoc</type> which does not exist in Maven. But what exists would be a javadoc package which has a classifier <classifier>javadoc</classifier>...and why is the javadoc part defined as <scope>provided</scope> which does not make sense..?
    – khmarbaise
    Nov 11 at 8:06










  • It does, as NMS(The part I am trying do get right) updates its package name with each version for example for v1_13_R1 the package name is: net.minecraft.server.v1_13_R1 and for v1_13_R2 it is: net.minecraft.server.v1_13_R2 and I need to make multiple modules since I can not make one module have multiple versions on the same artifact. Also I have no dependency as type javadoc
    – YourPalJake
    Nov 11 at 11:11










  • So, are you saying that if you identify your modules V1_13_R1 and V1_13_R2 with the same groupId and artifactId, but different version numbers, you cannot get Maven to have Library depend on both of them?
    – moilejter
    Nov 11 at 19:17












  • No the library that those modules use cannot be added as dependency with multiple versions in the same module
    – YourPalJake
    Nov 11 at 20:34


















  • It does not make sense having different versions of the same library on a classpath. This is basic Java and nothing to do with Maven. Furthermore I've seen a package with <type>javadoc</type> which does not exist in Maven. But what exists would be a javadoc package which has a classifier <classifier>javadoc</classifier>...and why is the javadoc part defined as <scope>provided</scope> which does not make sense..?
    – khmarbaise
    Nov 11 at 8:06










  • It does, as NMS(The part I am trying do get right) updates its package name with each version for example for v1_13_R1 the package name is: net.minecraft.server.v1_13_R1 and for v1_13_R2 it is: net.minecraft.server.v1_13_R2 and I need to make multiple modules since I can not make one module have multiple versions on the same artifact. Also I have no dependency as type javadoc
    – YourPalJake
    Nov 11 at 11:11










  • So, are you saying that if you identify your modules V1_13_R1 and V1_13_R2 with the same groupId and artifactId, but different version numbers, you cannot get Maven to have Library depend on both of them?
    – moilejter
    Nov 11 at 19:17












  • No the library that those modules use cannot be added as dependency with multiple versions in the same module
    – YourPalJake
    Nov 11 at 20:34
















It does not make sense having different versions of the same library on a classpath. This is basic Java and nothing to do with Maven. Furthermore I've seen a package with <type>javadoc</type> which does not exist in Maven. But what exists would be a javadoc package which has a classifier <classifier>javadoc</classifier>...and why is the javadoc part defined as <scope>provided</scope> which does not make sense..?
– khmarbaise
Nov 11 at 8:06




It does not make sense having different versions of the same library on a classpath. This is basic Java and nothing to do with Maven. Furthermore I've seen a package with <type>javadoc</type> which does not exist in Maven. But what exists would be a javadoc package which has a classifier <classifier>javadoc</classifier>...and why is the javadoc part defined as <scope>provided</scope> which does not make sense..?
– khmarbaise
Nov 11 at 8:06












It does, as NMS(The part I am trying do get right) updates its package name with each version for example for v1_13_R1 the package name is: net.minecraft.server.v1_13_R1 and for v1_13_R2 it is: net.minecraft.server.v1_13_R2 and I need to make multiple modules since I can not make one module have multiple versions on the same artifact. Also I have no dependency as type javadoc
– YourPalJake
Nov 11 at 11:11




It does, as NMS(The part I am trying do get right) updates its package name with each version for example for v1_13_R1 the package name is: net.minecraft.server.v1_13_R1 and for v1_13_R2 it is: net.minecraft.server.v1_13_R2 and I need to make multiple modules since I can not make one module have multiple versions on the same artifact. Also I have no dependency as type javadoc
– YourPalJake
Nov 11 at 11:11












So, are you saying that if you identify your modules V1_13_R1 and V1_13_R2 with the same groupId and artifactId, but different version numbers, you cannot get Maven to have Library depend on both of them?
– moilejter
Nov 11 at 19:17






So, are you saying that if you identify your modules V1_13_R1 and V1_13_R2 with the same groupId and artifactId, but different version numbers, you cannot get Maven to have Library depend on both of them?
– moilejter
Nov 11 at 19:17














No the library that those modules use cannot be added as dependency with multiple versions in the same module
– YourPalJake
Nov 11 at 20:34




No the library that those modules use cannot be added as dependency with multiple versions in the same module
– YourPalJake
Nov 11 at 20:34












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










So I've tried a different structure that did work. For the people who are reading this in the future and are having the same issue here is my GitHub repo AzortisLib



I hope this works for everyone!






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244350%2fmaven-cycleexception%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    So I've tried a different structure that did work. For the people who are reading this in the future and are having the same issue here is my GitHub repo AzortisLib



    I hope this works for everyone!






    share|improve this answer

























      up vote
      0
      down vote



      accepted










      So I've tried a different structure that did work. For the people who are reading this in the future and are having the same issue here is my GitHub repo AzortisLib



      I hope this works for everyone!






      share|improve this answer























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        So I've tried a different structure that did work. For the people who are reading this in the future and are having the same issue here is my GitHub repo AzortisLib



        I hope this works for everyone!






        share|improve this answer












        So I've tried a different structure that did work. For the people who are reading this in the future and are having the same issue here is my GitHub repo AzortisLib



        I hope this works for everyone!







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 19 at 15:13









        YourPalJake

        116




        116






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244350%2fmaven-cycleexception%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Florida Star v. B. J. F.

            Danny Elfman

            Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues