Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
75 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
hawtio-maven-plugin/src/main/java/io/hawt/maven/CamelMojo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package io.hawt.maven; | ||
|
||
import java.util.List; | ||
|
||
import org.apache.maven.plugins.annotations.LifecyclePhase; | ||
import org.apache.maven.plugins.annotations.Mojo; | ||
import org.apache.maven.plugins.annotations.Parameter; | ||
import org.apache.maven.plugins.annotations.ResolutionScope; | ||
|
||
@Mojo(name = "camel", defaultPhase = LifecyclePhase.TEST_COMPILE, requiresDependencyResolution = ResolutionScope.RUNTIME) | ||
public class CamelMojo extends RunMojo { | ||
|
||
@Parameter(property = "camel.applicationContextUri") | ||
private String applicationContextUri; | ||
|
||
@Parameter(property = "camel.fileApplicationContextUri") | ||
private String fileApplicationContextUri; | ||
|
||
@Override | ||
protected void addCustomArguments(List<String> args) { | ||
if (applicationContextUri != null) { | ||
args.add("-ac"); | ||
args.add(applicationContextUri); | ||
} else if (fileApplicationContextUri != null) { | ||
args.add("-fa"); | ||
args.add(fileApplicationContextUri); | ||
} | ||
|
||
if (mainClass != null) { | ||
getLog().info("Using custom " + mainClass + " to initiate a CamelContext"); | ||
} else { | ||
// use spring by default | ||
getLog().info("Using org.apache.camel.spring.Main to initiate a CamelContext"); | ||
mainClass = "org.apache.camel.spring.Main"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters