[ 
https://issues.apache.org/jira/browse/CAMEL-17310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17458021#comment-17458021
 ] 

Federico Mariani edited comment on CAMEL-17310 at 12/12/21, 6:24 PM:
---------------------------------------------------------------------

Exactly, route reload uses absolute path, I'll update camel:dev and will use 
absolute path too, moreover I noticed this running routeloader example:
{code:java}
19:03:02.593 [Camel (MyJavaLoader) thread #1 - FileWatcherReloadStrategy] INFO  
o.a.c.s.RouteWatcherReloadStrategy -     Started route4 (timer://java) (source: 
file:/home/federico/apache/camel-examples/examples/routeloader/target/classes/myroutes/MyRouteBuilder.java)
19:03:02.593 [Camel (MyJavaLoader) thread #1 - FileWatcherReloadStrategy] INFO  
o.a.c.s.RouteWatcherReloadStrategy -     Started route5 (timer://xml) (source: 
file:/home/federico/apache/camel-examples/examples/routeloader/target/classes/myroutes/cheese-route.xml)
19:03:02.593 [Camel (MyJavaLoader) thread #1 - FileWatcherReloadStrategy] INFO  
o.a.c.s.RouteWatcherReloadStrategy -     Started route6 (timer://yaml) (source: 
file:/home/federico/apache/camel-examples/examples/routeloader/target/classes/myroutes/my-yaml-route.yaml)
19:03:02.594 [Camel (MyJavaLoader) thread #1 - FileWatcherReloadStrategy] INFO  
o.a.c.s.RouteWatcherReloadStrategy -     Started route7 (timer://xml) (source: 
file:/home/federico/apache/camel-examples/examples/routeloader/src/main/resources/myroutes/cheese-route.xml)
 {code}
as you can see the reloaded route is loaded from 
*src/main/resources/myroutes/cheese-route.xml* while other routes are loaded 
from classpath {*}target/classes/myroutes/my-yaml-route.yaml{*}, maybe it 
depends from *camel.main.routes-include-pattern=classpath:myroutes/** specified 
in application.properties.

This works as exepected:
{code:java}
mvn camel:dev 
-Dcamel.routesDirectory=/home/federico/apache/camel-examples/examples/routeloader/target/classes/myroutes
{code}
Or the example can be updated with 
*camel.main.routes-include-pattern=myroutes/** in this way _mvn camel:dev_ is 
enough


was (Author: federico mariani):
Exactly, route reload uses absolute path, I'll update camel:dev and will use 
absolute path too, moreover I noticed this running routeloader example:
{code:java}
19:03:02.593 [Camel (MyJavaLoader) thread #1 - FileWatcherReloadStrategy] INFO  
o.a.c.s.RouteWatcherReloadStrategy -     Started route4 (timer://java) (source: 
file:/home/federico/apache/camel-examples/examples/routeloader/target/classes/myroutes/MyRouteBuilder.java)
19:03:02.593 [Camel (MyJavaLoader) thread #1 - FileWatcherReloadStrategy] INFO  
o.a.c.s.RouteWatcherReloadStrategy -     Started route5 (timer://xml) (source: 
file:/home/federico/apache/camel-examples/examples/routeloader/target/classes/myroutes/cheese-route.xml)
19:03:02.593 [Camel (MyJavaLoader) thread #1 - FileWatcherReloadStrategy] INFO  
o.a.c.s.RouteWatcherReloadStrategy -     Started route6 (timer://yaml) (source: 
file:/home/federico/apache/camel-examples/examples/routeloader/target/classes/myroutes/my-yaml-route.yaml)
19:03:02.594 [Camel (MyJavaLoader) thread #1 - FileWatcherReloadStrategy] INFO  
o.a.c.s.RouteWatcherReloadStrategy -     Started route7 (timer://xml) (source: 
file:/home/federico/apache/camel-examples/examples/routeloader/src/main/resources/myroutes/cheese-route.xml)
 {code}
as you can see the reloaded route is loaded from 
*src/main/resources/myroutes/cheese-route.xml* while other routes are loaded 
from classpath {*}target/classes/myroutes/my-yaml-route.yaml{*}, maybe it 
depends from *camel.main.routes-include-pattern=classpath:myroutes/** specified 
in application.properties.

This works as exepected:
{code:java}
mvn camel:dev 
-Dcamel.routesDirectory=/home/federico/apache/camel-examples/examples/routeloader/target/classes/myroutes
{code}

> maven camel:run - Add option for route reload
> ---------------------------------------------
>
>                 Key: CAMEL-17310
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17310
>             Project: Camel
>          Issue Type: New Feature
>          Components: tooling
>            Reporter: Claus Ibsen
>            Assignee: Federico Mariani
>            Priority: Major
>             Fix For: 3.15.0
>
>
> Like we have with camel-jbang and its --reload option, then we can have 
> something similar for mvn camel:run - however we could also consider naming 
> it mvn camel:dev



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to