Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run cargo/jboss without war deployment #147

Open
spyhunter99 opened this issue May 19, 2016 · 2 comments
Open

Run cargo/jboss without war deployment #147

spyhunter99 opened this issue May 19, 2016 · 2 comments

Comments

@spyhunter99
Copy link

I have a use case to run integration tests on a JAR project which interacts with a jboss based web application. The goal is to fire up jboss instance that's preconfigured with war files, etc before running integration junit tests, run the tests, then stop jboss after the tests have been completed. Right now i'm running "gradle cargoStartLocal" with the following snippet

cargo{ local{ homeDir=file("$rootDir/jboss") } containerId='jboss61x' port = 8888 }

And I'm running into the "Cannot get property 'cannonicalPath' on a null object, thrown by LocalCargoContainerTask.validateConfiguration, line 138.

Is this a supported configuration or anything I can do to force it to work this way?

@jutoft
Copy link

jutoft commented Jan 2, 2019

Have you tried if it works if you use the CargoBasePlugin?
The CargoPlugin is definently broken when handling an empty list of deployables.

Here is a few things that might brake the list of deployables.

static File getProjectDeployableFile(Project project) {
if(project.plugins.hasPlugin(WarPlugin.WAR_TASK_NAME)) {
return project.tasks.getByName(WarPlugin.WAR_TASK_NAME).archivePath
}
else if(project.plugins.hasPlugin(EarPlugin.EAR_TASK_NAME)) {
return project.tasks.getByName(EarPlugin.EAR_TASK_NAME).archivePath
}
}

Here i do not know if a default file object will be returned or null. If it's a default file object then a invalid file will be added to the list.

if(cargoConvention.deployables.size() == 0) {
deployables << new Deployable(file: ProjectInfoHelper.getProjectDeployableFile(project))
}
else {
cargoConvention.deployables.each { deployable ->
if(!deployable.file) {
deployable.file = ProjectInfoHelper.getProjectDeployableFile(project)
}
deployables << deployable
}
}

Is definently broken, it will add an item even though you do not want it to, it will even fallback to an invalid file if you define a path to a file that doesn't exist.

@jutoft
Copy link

jutoft commented Jan 21, 2019

#181 should fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants