Well, the java files have to be recompiled  to trigger the restart in
Spring Boot. So it should not be supported by camel jbang.

On Wed, Aug 28, 2024 at 10:39 PM Zheng Feng <zf...@redhat.com> wrote:

> Hmm, I get it to work in Quarkus runtime. But for Spring Boot, it does not
> work because SB does not support running applications from the default
> package. I get the following error:
>
> ** WARNING ** : Your ApplicationContext is unlikely to start due to a
> @ComponentScan of the default package.
>
> Also there are some codes which need to add in the source java file, see
> [1]
>
> [1]
> https://github.com/apache/camel/blob/main/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportSpringBoot.java#L363
>
> On Wed, Aug 28, 2024 at 7:50 PM Zheng Feng <zf...@redhat.com> wrote:
>
>> OK, I will take a look.
>>
>> On Wed, Aug 28, 2024 at 7:38 PM Claus Ibsen <claus.ib...@gmail.com>
>> wrote:
>>
>>> On Wed, Aug 28, 2024 at 12:46 PM Zheng Feng <zf...@redhat.com> wrote:
>>>
>>> > Thanks Claus, I get your idea! safe_copy() could do this work. I will
>>> > investigate.
>>> >
>>> >
>>> Here is a JIRA ticket about this
>>> https://issues.apache.org/jira/browse/CAMEL-21130
>>>
>>>
>>> > On Wed, Aug 28, 2024 at 6:33 PM Claus Ibsen <claus.ib...@gmail.com>
>>> wrote:
>>> >
>>> > > On Wed, Aug 28, 2024 at 12:13 PM Claus Ibsen <claus.ib...@gmail.com>
>>> > > wrote:
>>> > >
>>> > > > Hi
>>> > > >
>>> > > > This used to work in the past. Where jbang would use symbolic
>>> links for
>>> > > > the files.
>>> > > > Though it may be that something is not working as well anymore.
>>> > > >
>>> > > > See the ExportBaseCommand
>>> > > >
>>> > > >
>>> > > Ah okay so this would not work for .java source files as they need
>>> to be
>>> > > adjusted during export to have package name and what else.
>>> > > If you edit yaml routes then it should work.
>>> > >
>>> > > It may be that we can find out to make it possible to have .java
>>> files
>>> > > working as well.
>>> > > At a starter if they have package name then they can be used
>>> > > without adjustments and should therefore work also.
>>> > > For non package java then we may just copy it to root in --dev so its
>>> > > package less and then reloading should work.
>>> > >
>>> > >
>>> > >
>>> > > >
>>> > > > On Wed, Aug 28, 2024 at 11:54 AM Zheng Feng <zf...@redhat.com>
>>> wrote:
>>> > > >
>>> > > >> Hi,
>>> > > >>
>>> > > >> I just use "camel run foo.java --runtime=quarkus --dev" and
>>> modify the
>>> > > >> foo.java, but the app does not reload the changes. I think it is
>>> > > expected
>>> > > >> since when running with quarkus or spring-boot, it has to be
>>> exported
>>> > > to a
>>> > > >> hidden directory like .camel-jang-run at first. So even if we add
>>> the
>>> > > >> "--dev" option, the changes in the original foo.java does not
>>> apply to
>>> > > the
>>> > > >> exported project.
>>> > > >>
>>> > > >> I wonder if the dev mode is not possible with quarkus or
>>> spring-boot
>>> > > >> runtime? Or do we have to add some watch file services to
>>> re-export it
>>> > > >> automatically?
>>> > > >>
>>> > > >
>>> > > >
>>> > > > --
>>> > > > Claus Ibsen
>>> > > > -----------------
>>> > > > @davsclaus
>>> > > > Camel in Action 2: https://www.manning.com/ibsen2
>>> > > >
>>> > >
>>> > >
>>> > > --
>>> > > Claus Ibsen
>>> > > -----------------
>>> > > @davsclaus
>>> > > Camel in Action 2: https://www.manning.com/ibsen2
>>> > >
>>> >
>>>
>>>
>>> --
>>> Claus Ibsen
>>> -----------------
>>> @davsclaus
>>> Camel in Action 2: https://www.manning.com/ibsen2
>>>
>>

Reply via email to