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

targetModule in properties file causes dspot to exit immediately with no result #798

Closed
gibello opened this issue May 17, 2019 · 7 comments
Assignees
Labels
bug maven-plugin This issue is related to the module DSpot - Maven

Comments

@gibello
Copy link

gibello commented May 17, 2019

Characteristics

  • Issue Type: bug
  • Reproducibility: always
  • Severity: major
  • Tool/Service/Component: DSpot maven plugin 2.1.1-SNAPSHOT
  • Execution Environment: Ubuntu Linux 18.04
  • Reporter: Pierre-Yves Gibello, [email protected]

Description

When specifying a targetModule in DSpot properties file, DSpot maven plugin runs fine, but exits with "BUILD SUCCESS" within a few seconds with no output at all.

Steps to reproduce

Tested on authzforce core project (https://gitlab.ow2.org/authzforce/core).

dspot.properties file contains just one line:
targetModule: pdp-engine

Then DSpot is launched as follows:
mvn eu.stamp-project:dspot-maven:2.1.1-SNAPSHOT:amplify-unit-tests -Dpath-to-properties=dspot.properties

Exits with "BUILD SUCCESS" after 6 seconds, and DSpot does not seem to be invoked at all.

@danglotb
Copy link
Member

Hi @gibello

Thank you for reporting this.

There is an issue between default values and (not) specified values in the properties.

I'll work on this and propose a fix ASAP.

Meanwhile, you can either specify the project property in your properties file or use dspot-maven from your module instead of from its parent.

For the latter option, you may face classpath issue and need to run mvn dependency:resolve before.

@danglotb danglotb self-assigned this May 17, 2019
@danglotb danglotb added bug maven-plugin This issue is related to the module DSpot - Maven labels May 17, 2019
@danglotb
Copy link
Member

Hello, #808 should fix this.

@gibello
Copy link
Author

gibello commented Jun 7, 2019

Hi @danglotb , does not seem to fix anything... Did I do something wrong ?

git checkout -b danglotb-refactor-inputs-management master
git pull https://github.com/danglotb/dspot.git refactor-inputs-management
mvn clean install package -DskipTests

Then test again...

@danglotb
Copy link
Member

danglotb commented Jun 7, 2019

From where do you run DSpot? You should run it from the top parent of your project, i.e core folder.

Your properties file is not well formatted, it should be:

targetModule=pdp-engine

using the = symbol instead of :. Thus, you have a white space in the value, that can lead to a wrong folder in DSpot (DSpot will concatenate this value with the root of the project to reach the root of the targeted module).

@gibello
Copy link
Author

gibello commented Jun 7, 2019

Tried this, no change.
No surprise: the ":" syntax is valid as well (if you don't put a white space after the value - the reason why it is always better to trim props before use, but the "=" does not solve that).

@gibello
Copy link
Author

gibello commented Jun 7, 2019

@danglotb : Just added "project=/home/gibello/STAMP/STAMP-project/authzforce-gibello/core" in the dspot.properties, AND IT WORKS.

There is definitely an issue with that "project" stuff (I have a java invoker to call DSpot, and without "project" set, it fails with a "null" inserted in the path... I mean the way the path is built is buggy, and unpredictable depending on runtime environment).

@danglotb
Copy link
Member

danglotb commented Jun 7, 2019

@danglotb : Just added "project=/home/gibello/STAMP/STAMP-project/authzforce-gibello/core" in the dspot.properties, AND IT WORKS.

Seems weird. I saw that there is a bug in the maven-plugin in the detection of the targeted module. I'm looking at it.

There is definitely an issue with that "project" stuff (I have a java invoker to call DSpot, and without "project" set, it fails with a "null" inserted in the path... I mean the way the path is built is buggy, and unpredictable depending on runtime environment).

Yes, the property project MUST be specified (as said in the documentation).

The dspot-maven plugin infers this information, if not specified, from the pom.xml to make the usage easier.

However, from the command line, one must specify this property.

If you do use DSpot's API, I suggest you use also the eu.stamp_project.utils.options.check.Checker class, to ensure that you have correct inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug maven-plugin This issue is related to the module DSpot - Maven
Projects
None yet
Development

No branches or pull requests

2 participants