Include IUs via category.xml without categorizing them with Tycho












2














Since Tycho 0.23 it is possible to include installable units (IUs) into the final p2 repository by declaring them in the category.xml



For example, to include a Gson parser that is required by one of my bundles, I can write the following:



<iu id="com.google.gson">
<query>
<expression type="match">
id == com.google.gson &amp;&amp; version &gt;= 2.2.0 &amp;&amp; version &lt; 3.0.0
</expression>
</query>
</iu>


The IUs to be included are only meant to fulfil dependencies of the main features of the repository. They are not meant to be installed on their own.



Previously I was using the tycho-extras mirror goal to include additional IUs and though I thought that I could now move the 'include IUs' directives to the category.xml which spares me to redundantly maintain repository URLs.



But unfortunately the IUs that are included via the category.xml appear under an Uncategorized category when the generated repository is shown in the Eclipse Install Software dialog.



Documentation is sparse, thus I'm asking here if there is a way exclude IUs from any category or define a 'hidden' category?










share|improve this question



























    2














    Since Tycho 0.23 it is possible to include installable units (IUs) into the final p2 repository by declaring them in the category.xml



    For example, to include a Gson parser that is required by one of my bundles, I can write the following:



    <iu id="com.google.gson">
    <query>
    <expression type="match">
    id == com.google.gson &amp;&amp; version &gt;= 2.2.0 &amp;&amp; version &lt; 3.0.0
    </expression>
    </query>
    </iu>


    The IUs to be included are only meant to fulfil dependencies of the main features of the repository. They are not meant to be installed on their own.



    Previously I was using the tycho-extras mirror goal to include additional IUs and though I thought that I could now move the 'include IUs' directives to the category.xml which spares me to redundantly maintain repository URLs.



    But unfortunately the IUs that are included via the category.xml appear under an Uncategorized category when the generated repository is shown in the Eclipse Install Software dialog.



    Documentation is sparse, thus I'm asking here if there is a way exclude IUs from any category or define a 'hidden' category?










    share|improve this question

























      2












      2








      2







      Since Tycho 0.23 it is possible to include installable units (IUs) into the final p2 repository by declaring them in the category.xml



      For example, to include a Gson parser that is required by one of my bundles, I can write the following:



      <iu id="com.google.gson">
      <query>
      <expression type="match">
      id == com.google.gson &amp;&amp; version &gt;= 2.2.0 &amp;&amp; version &lt; 3.0.0
      </expression>
      </query>
      </iu>


      The IUs to be included are only meant to fulfil dependencies of the main features of the repository. They are not meant to be installed on their own.



      Previously I was using the tycho-extras mirror goal to include additional IUs and though I thought that I could now move the 'include IUs' directives to the category.xml which spares me to redundantly maintain repository URLs.



      But unfortunately the IUs that are included via the category.xml appear under an Uncategorized category when the generated repository is shown in the Eclipse Install Software dialog.



      Documentation is sparse, thus I'm asking here if there is a way exclude IUs from any category or define a 'hidden' category?










      share|improve this question













      Since Tycho 0.23 it is possible to include installable units (IUs) into the final p2 repository by declaring them in the category.xml



      For example, to include a Gson parser that is required by one of my bundles, I can write the following:



      <iu id="com.google.gson">
      <query>
      <expression type="match">
      id == com.google.gson &amp;&amp; version &gt;= 2.2.0 &amp;&amp; version &lt; 3.0.0
      </expression>
      </query>
      </iu>


      The IUs to be included are only meant to fulfil dependencies of the main features of the repository. They are not meant to be installed on their own.



      Previously I was using the tycho-extras mirror goal to include additional IUs and though I thought that I could now move the 'include IUs' directives to the category.xml which spares me to redundantly maintain repository URLs.



      But unfortunately the IUs that are included via the category.xml appear under an Uncategorized category when the generated repository is shown in the Eclipse Install Software dialog.



      Documentation is sparse, thus I'm asking here if there is a way exclude IUs from any category or define a 'hidden' category?







      eclipse tycho






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 5 '16 at 17:34









      Rüdiger Herrmann

      15.1k103252




      15.1k103252
























          3 Answers
          3






          active

          oldest

          votes


















          0














          In order to have the update site running but not showing any IU/Category, simply remove the <iu>...</iu> tags (and the content inside). In other words, keep your category.xml file empty.



          You will see that the generated content.xml file will list all the IUs, but when browsing none will be "installable".



          Here (https://github.com/antoine-morvan/p2-repo-example) is a sample project that builds a P2 repo from Maven dependencies using custom category.xml. Only one dependency is included, jgraph:5.13 along with its source, resulting in two bundles. In the provided category.xml, categories are defined, but no feature/iu is.



          After you generate the site and browse it with Eclipse, nothing will be shown. However, if you look at the content of content.xml, you will see that the bundles are correctly provided. That means this p2 repository can be used/referenced for missing dependencies, custom installs...



          Hope that helps, best regards.






          share|improve this answer





















          • The linked example isn't using Tycho. Thus, I believe this is either a feature or a bug (works by accident) the org.reficio p2-maven-plugin.
            – Gunnar
            Nov 12 at 12:35





















          0














          There doesn't seem a way to add IUs to a category.xml without having them categorized, i.e. they will always show up in a category.



          However, there are two workarounds available:



          (1) To include all dependencies (including transitive dependencies) in your final p2 repository set configuration option includeAllDependencies to true in the pom.xml configuration of the p2-repository-plugin. The downside is that this will really include everything, i.e. if you are developing an Eclipse plug-in the final repository will include a ton of Eclipse plug-ins such as Eclipse Platform, Equinox, SWT. Not sure this is wanted.



          (2) If you don't mind some post processing you can remove the "Uncategorized" category after building the repository. There is a p2.remove.iu Ant task.



          <p2.remove.iu>
          <repository location="file://${repositoryOnBuildMachine}" />
          <iu query="property[@name='org.eclipse.equinox.p2.name' @value='Uncategorized']" />
          </p2.remove.iu>


          Sources:




          • https://bugs.eclipse.org/404103

          • https://www.eclipse.org/lists/tycho-user/msg03759.html






          share|improve this answer































            -1














            looking at the very sparse documentation (I also agree) I think you can add the category in your element. Such as this :



            <iu id="com.google.gson">
            <category name="javax"/> <<<<<<- here
            <query>
            <expression type="match">
            id == com.google.gson &amp;&amp; version &gt;= 2.2.0 &amp;&amp; version &lt; 3.0.0
            </expression>
            </query>
            </iu>





            share|improve this answer





















            • Please re-read the question. How would that exclude IUs from any category or define a 'hidden' category?
              – Rüdiger Herrmann
              Jan 20 '16 at 16:08











            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',
            autoActivateHeartbeat: false,
            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%2f34617854%2finclude-ius-via-category-xml-without-categorizing-them-with-tycho%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            In order to have the update site running but not showing any IU/Category, simply remove the <iu>...</iu> tags (and the content inside). In other words, keep your category.xml file empty.



            You will see that the generated content.xml file will list all the IUs, but when browsing none will be "installable".



            Here (https://github.com/antoine-morvan/p2-repo-example) is a sample project that builds a P2 repo from Maven dependencies using custom category.xml. Only one dependency is included, jgraph:5.13 along with its source, resulting in two bundles. In the provided category.xml, categories are defined, but no feature/iu is.



            After you generate the site and browse it with Eclipse, nothing will be shown. However, if you look at the content of content.xml, you will see that the bundles are correctly provided. That means this p2 repository can be used/referenced for missing dependencies, custom installs...



            Hope that helps, best regards.






            share|improve this answer





















            • The linked example isn't using Tycho. Thus, I believe this is either a feature or a bug (works by accident) the org.reficio p2-maven-plugin.
              – Gunnar
              Nov 12 at 12:35


















            0














            In order to have the update site running but not showing any IU/Category, simply remove the <iu>...</iu> tags (and the content inside). In other words, keep your category.xml file empty.



            You will see that the generated content.xml file will list all the IUs, but when browsing none will be "installable".



            Here (https://github.com/antoine-morvan/p2-repo-example) is a sample project that builds a P2 repo from Maven dependencies using custom category.xml. Only one dependency is included, jgraph:5.13 along with its source, resulting in two bundles. In the provided category.xml, categories are defined, but no feature/iu is.



            After you generate the site and browse it with Eclipse, nothing will be shown. However, if you look at the content of content.xml, you will see that the bundles are correctly provided. That means this p2 repository can be used/referenced for missing dependencies, custom installs...



            Hope that helps, best regards.






            share|improve this answer





















            • The linked example isn't using Tycho. Thus, I believe this is either a feature or a bug (works by accident) the org.reficio p2-maven-plugin.
              – Gunnar
              Nov 12 at 12:35
















            0












            0








            0






            In order to have the update site running but not showing any IU/Category, simply remove the <iu>...</iu> tags (and the content inside). In other words, keep your category.xml file empty.



            You will see that the generated content.xml file will list all the IUs, but when browsing none will be "installable".



            Here (https://github.com/antoine-morvan/p2-repo-example) is a sample project that builds a P2 repo from Maven dependencies using custom category.xml. Only one dependency is included, jgraph:5.13 along with its source, resulting in two bundles. In the provided category.xml, categories are defined, but no feature/iu is.



            After you generate the site and browse it with Eclipse, nothing will be shown. However, if you look at the content of content.xml, you will see that the bundles are correctly provided. That means this p2 repository can be used/referenced for missing dependencies, custom installs...



            Hope that helps, best regards.






            share|improve this answer












            In order to have the update site running but not showing any IU/Category, simply remove the <iu>...</iu> tags (and the content inside). In other words, keep your category.xml file empty.



            You will see that the generated content.xml file will list all the IUs, but when browsing none will be "installable".



            Here (https://github.com/antoine-morvan/p2-repo-example) is a sample project that builds a P2 repo from Maven dependencies using custom category.xml. Only one dependency is included, jgraph:5.13 along with its source, resulting in two bundles. In the provided category.xml, categories are defined, but no feature/iu is.



            After you generate the site and browse it with Eclipse, nothing will be shown. However, if you look at the content of content.xml, you will see that the bundles are correctly provided. That means this p2 repository can be used/referenced for missing dependencies, custom installs...



            Hope that helps, best regards.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Apr 6 '17 at 9:12









            Koubi

            114




            114












            • The linked example isn't using Tycho. Thus, I believe this is either a feature or a bug (works by accident) the org.reficio p2-maven-plugin.
              – Gunnar
              Nov 12 at 12:35




















            • The linked example isn't using Tycho. Thus, I believe this is either a feature or a bug (works by accident) the org.reficio p2-maven-plugin.
              – Gunnar
              Nov 12 at 12:35


















            The linked example isn't using Tycho. Thus, I believe this is either a feature or a bug (works by accident) the org.reficio p2-maven-plugin.
            – Gunnar
            Nov 12 at 12:35






            The linked example isn't using Tycho. Thus, I believe this is either a feature or a bug (works by accident) the org.reficio p2-maven-plugin.
            – Gunnar
            Nov 12 at 12:35















            0














            There doesn't seem a way to add IUs to a category.xml without having them categorized, i.e. they will always show up in a category.



            However, there are two workarounds available:



            (1) To include all dependencies (including transitive dependencies) in your final p2 repository set configuration option includeAllDependencies to true in the pom.xml configuration of the p2-repository-plugin. The downside is that this will really include everything, i.e. if you are developing an Eclipse plug-in the final repository will include a ton of Eclipse plug-ins such as Eclipse Platform, Equinox, SWT. Not sure this is wanted.



            (2) If you don't mind some post processing you can remove the "Uncategorized" category after building the repository. There is a p2.remove.iu Ant task.



            <p2.remove.iu>
            <repository location="file://${repositoryOnBuildMachine}" />
            <iu query="property[@name='org.eclipse.equinox.p2.name' @value='Uncategorized']" />
            </p2.remove.iu>


            Sources:




            • https://bugs.eclipse.org/404103

            • https://www.eclipse.org/lists/tycho-user/msg03759.html






            share|improve this answer




























              0














              There doesn't seem a way to add IUs to a category.xml without having them categorized, i.e. they will always show up in a category.



              However, there are two workarounds available:



              (1) To include all dependencies (including transitive dependencies) in your final p2 repository set configuration option includeAllDependencies to true in the pom.xml configuration of the p2-repository-plugin. The downside is that this will really include everything, i.e. if you are developing an Eclipse plug-in the final repository will include a ton of Eclipse plug-ins such as Eclipse Platform, Equinox, SWT. Not sure this is wanted.



              (2) If you don't mind some post processing you can remove the "Uncategorized" category after building the repository. There is a p2.remove.iu Ant task.



              <p2.remove.iu>
              <repository location="file://${repositoryOnBuildMachine}" />
              <iu query="property[@name='org.eclipse.equinox.p2.name' @value='Uncategorized']" />
              </p2.remove.iu>


              Sources:




              • https://bugs.eclipse.org/404103

              • https://www.eclipse.org/lists/tycho-user/msg03759.html






              share|improve this answer


























                0












                0








                0






                There doesn't seem a way to add IUs to a category.xml without having them categorized, i.e. they will always show up in a category.



                However, there are two workarounds available:



                (1) To include all dependencies (including transitive dependencies) in your final p2 repository set configuration option includeAllDependencies to true in the pom.xml configuration of the p2-repository-plugin. The downside is that this will really include everything, i.e. if you are developing an Eclipse plug-in the final repository will include a ton of Eclipse plug-ins such as Eclipse Platform, Equinox, SWT. Not sure this is wanted.



                (2) If you don't mind some post processing you can remove the "Uncategorized" category after building the repository. There is a p2.remove.iu Ant task.



                <p2.remove.iu>
                <repository location="file://${repositoryOnBuildMachine}" />
                <iu query="property[@name='org.eclipse.equinox.p2.name' @value='Uncategorized']" />
                </p2.remove.iu>


                Sources:




                • https://bugs.eclipse.org/404103

                • https://www.eclipse.org/lists/tycho-user/msg03759.html






                share|improve this answer














                There doesn't seem a way to add IUs to a category.xml without having them categorized, i.e. they will always show up in a category.



                However, there are two workarounds available:



                (1) To include all dependencies (including transitive dependencies) in your final p2 repository set configuration option includeAllDependencies to true in the pom.xml configuration of the p2-repository-plugin. The downside is that this will really include everything, i.e. if you are developing an Eclipse plug-in the final repository will include a ton of Eclipse plug-ins such as Eclipse Platform, Equinox, SWT. Not sure this is wanted.



                (2) If you don't mind some post processing you can remove the "Uncategorized" category after building the repository. There is a p2.remove.iu Ant task.



                <p2.remove.iu>
                <repository location="file://${repositoryOnBuildMachine}" />
                <iu query="property[@name='org.eclipse.equinox.p2.name' @value='Uncategorized']" />
                </p2.remove.iu>


                Sources:




                • https://bugs.eclipse.org/404103

                • https://www.eclipse.org/lists/tycho-user/msg03759.html







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 12 at 13:21

























                answered Nov 12 at 12:46









                Gunnar

                1,8981023




                1,8981023























                    -1














                    looking at the very sparse documentation (I also agree) I think you can add the category in your element. Such as this :



                    <iu id="com.google.gson">
                    <category name="javax"/> <<<<<<- here
                    <query>
                    <expression type="match">
                    id == com.google.gson &amp;&amp; version &gt;= 2.2.0 &amp;&amp; version &lt; 3.0.0
                    </expression>
                    </query>
                    </iu>





                    share|improve this answer





















                    • Please re-read the question. How would that exclude IUs from any category or define a 'hidden' category?
                      – Rüdiger Herrmann
                      Jan 20 '16 at 16:08
















                    -1














                    looking at the very sparse documentation (I also agree) I think you can add the category in your element. Such as this :



                    <iu id="com.google.gson">
                    <category name="javax"/> <<<<<<- here
                    <query>
                    <expression type="match">
                    id == com.google.gson &amp;&amp; version &gt;= 2.2.0 &amp;&amp; version &lt; 3.0.0
                    </expression>
                    </query>
                    </iu>





                    share|improve this answer





















                    • Please re-read the question. How would that exclude IUs from any category or define a 'hidden' category?
                      – Rüdiger Herrmann
                      Jan 20 '16 at 16:08














                    -1












                    -1








                    -1






                    looking at the very sparse documentation (I also agree) I think you can add the category in your element. Such as this :



                    <iu id="com.google.gson">
                    <category name="javax"/> <<<<<<- here
                    <query>
                    <expression type="match">
                    id == com.google.gson &amp;&amp; version &gt;= 2.2.0 &amp;&amp; version &lt; 3.0.0
                    </expression>
                    </query>
                    </iu>





                    share|improve this answer












                    looking at the very sparse documentation (I also agree) I think you can add the category in your element. Such as this :



                    <iu id="com.google.gson">
                    <category name="javax"/> <<<<<<- here
                    <query>
                    <expression type="match">
                    id == com.google.gson &amp;&amp; version &gt;= 2.2.0 &amp;&amp; version &lt; 3.0.0
                    </expression>
                    </query>
                    </iu>






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jan 20 '16 at 15:35









                    SeB.Fr

                    547615




                    547615












                    • Please re-read the question. How would that exclude IUs from any category or define a 'hidden' category?
                      – Rüdiger Herrmann
                      Jan 20 '16 at 16:08


















                    • Please re-read the question. How would that exclude IUs from any category or define a 'hidden' category?
                      – Rüdiger Herrmann
                      Jan 20 '16 at 16:08
















                    Please re-read the question. How would that exclude IUs from any category or define a 'hidden' category?
                    – Rüdiger Herrmann
                    Jan 20 '16 at 16:08




                    Please re-read the question. How would that exclude IUs from any category or define a 'hidden' category?
                    – Rüdiger Herrmann
                    Jan 20 '16 at 16:08


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f34617854%2finclude-ius-via-category-xml-without-categorizing-them-with-tycho%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

                    List item for chat from Array inside array React Native

                    Thiostrepton

                    Caerphilly