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

feature: add support for multi-module Gradle projects #95

Open
paraita opened this issue Mar 27, 2017 · 3 comments
Open

feature: add support for multi-module Gradle projects #95

paraita opened this issue Mar 27, 2017 · 3 comments
Assignees
Labels

Comments

@paraita
Copy link
Contributor

paraita commented Mar 27, 2017

This is probably just a misunderstanding from my side but I can't seem to get Dspot to run on my code.

java -jar target/dspot-1.0.0-jar-with-dependencies.jar -p dspot_scheduling.properties 
00:12 DEBUG: run maven, phase: [clean, test, -DskipTests], timeout -1
00:13 DEBUG: [INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.046 s
[INFO] Finished at: 2017-03-27T15:55:11+02:00
[INFO] Final Memory: 13M/360M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/paraita/src/dspot/tmpDir/tmp). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException

00:13 DEBUG: timeOut init: 1
00:14 DEBUG: all children process kill (pid: 26090)
00:14 DEBUG: timeOut init: 4
00:14 DEBUG: run maven, phase: [eclipse:eclipse], timeout -1
00:15 DEBUG: timeOut init: 1
00:16 DEBUG: all children process kill (pid: 26090)
00:16 INFO: resolveURL dependencies of tmpDir/tmp/pom.xml
Exception in thread "main" java.lang.RuntimeException: java.io.FileNotFoundException: tmpDir/tmp/pom.xml (Aucun fichier ou dossier de ce type)
	at fr.inria.diversify.dspot.support.MavenDependenciesResolver.getMavenProject(MavenDependenciesResolver.java:112)
	at fr.inria.diversify.dspot.support.MavenDependenciesResolver.buildUrls(MavenDependenciesResolver.java:50)
	at fr.inria.diversify.dspot.support.MavenDependenciesResolver.resolveDependencies(MavenDependenciesResolver.java:40)
	at fr.inria.diversify.dspot.AmplificationHelper.getDependenciesOf(AmplificationHelper.java:213)
	at fr.inria.diversify.dspot.DSpot.<init>(DSpot.java:111)
	at fr.inria.stamp.Main.run(Main.java:34)
	at fr.inria.stamp.Main.main(Main.java:22)
Caused by: java.io.FileNotFoundException: tmpDir/tmp/pom.xml (Aucun fichier ou dossier de ce type)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at java.io.FileReader.<init>(FileReader.java:72)
	at fr.inria.diversify.dspot.support.MavenDependenciesResolver.getMavenProject(MavenDependenciesResolver.java:98)
	... 6 more

I have dspot cloned into /home/paraita/src/dspot and my code to test is in /home/paraita/src/scheduling.
Here is the property file I'm using to tell Dspot where to find my code:

#relative path to the project root from dspot project
project=../scheduling
#relative path to the source project from the project properties
src=../scheduling/scheduler/scheduler-api/src/main
#relative path to the test source project from the project properties
testSrc=../scheduling/scheduler/scheduler-api/src/test
#java version used
javaVersion=7
# (optional) path to the output folder, default to "output_diversify"
outputDirectory=dspot-out/
# (optional) filter on the package name containing tests to be amplified ("example" => "example.*"
#filter=example

I also tried to set absolute paths instead of relatives but I still get the same error.
Could you help me understand this ?
Thanks in advance !

@danglotb
Copy link
Member

danglotb commented Mar 27, 2017

Hello,

DSpot runs only (for now) on maven project. Does scheduling is a maven project?

According to your relative path to the source project:
src=../scheduling/scheduler/scheduler-api/src/main
You are targeting a multi-module project, isn't? I am sorry, but dspot does not support multi module. You have to target modules separately. However, if you configured a pom parent with some usefull values, dspot will be able to use it.

I would suggest to change the project property: project=../scheduling to project=../scheduling/scheduler/scheduler-api/ if there is a pom.xml in ../scheduling/scheduler/scheduler-api/

Also, values of src and testSrc are computed relatively to the value of project.

To sum up, could you try to use the following properties file:

#relative path to the project root from dspot project
project=../scheduling/scheduler/scheduler-api/
#relative path to the source project from the project properties
src=src/main
#relative path to the test source project from the project properties
testSrc=src/test
#java version used
javaVersion=7
# (optional) path to the output folder, default to "output_diversify"
outputDirectory=dspot-out/
# (optional) filter on the package name containing tests to be amplified ("example" => "example.*"
#filter=example

Thank you!

-- Benjamin.

@paraita
Copy link
Contributor Author

paraita commented Mar 28, 2017

Thanks you for your answer Benjamin,
scheduling is a (multi-modules) gradle project. I guess I'll need to see on my side if I can put time into creating some pom.xml files for the sub-modules, in the mean time I'll close that issue, thanks for the clarification :)

@paraita paraita closed this as completed Mar 28, 2017
@monperrus monperrus changed the title FileNotFoundException when trying to run Dspot on my code feature: add support for multi-module Gradle projects Dec 13, 2017
@monperrus monperrus reopened this Dec 13, 2017
@monperrus
Copy link
Member

Per our discussion, @danzone will investigate the multimodule support in Gradle.

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

No branches or pull requests

4 participants