Comments (9)
Hm, what's your setup?
I can run e.g. the project's own tests in maven and in intellij and they both work.
from code-assert.
Versions
- Maven 3.5.0
- IntelliJ 2017.2.3
- code-assert 0.0.13
Working directory when running tests
- Maven always uses the current module root as the working directory.
- IntelliJ uses the project root as the working directing.
AnalyzerConfig.maven().main()
- Maven full build: works
- Maven module build: works
- IntelliJ: breaks with
Invalid directory or JAR file: target/classes
AnalyzerConfig.maven(module).main()
- Maven full build: breaks with
Invalid directory or JAR file: mymodule/target/classes
- Maven module build: breaks with
Invalid directory or JAR file: mymodule/target/classes
- IntelliJ: works
One more thing in case this helps: my base test case is in a separate test
module which is added in test scope to every other module which then contains its own subclass with the rules for that module.
from code-assert.
Are you using windows?
There is already a check, but probably not os-safe.
from code-assert.
Yes, Win 10 x64
from code-assert.
Should be fixed in 0.8.1
from code-assert.
This appears to still be broken in IntelliJ with 0.8.2. I still need to use my workaround with that version.
from code-assert.
I still cannot reproduce the error.
The check is here:
Could you try and see what's going on? Thanks!
from code-assert.
Upon further testing, AnalyzerConfig.maven(module).main()
now works both in Maven and IntelliJ.
AnalyzerConfig.maven().main()
remains broken in IntelliJ, but in a different way: nothing is found! In this case the runningInModuleDir()
method you mentioned also is not called.
from code-assert.
In this case, I guess, the working dir is the project root. Without a given module
, how can it know the correct dir?
Btw I still cannot reproduce this. How exactly do you run the test with IntelliJ so that the working dir is not the module dir?
from code-assert.
Related Issues (20)
- Java 9 support HOT 7
- Externals should fail dependency rules if not used HOT 3
- support other JVM languages
- support analyzing jar files
- support minimal source code parsing
- [Question] Why I got these forbidden dependencies? HOT 1
- Should "io.reactivex.*" match the "io.reactivex" package (and not only its sub packages)? HOT 1
- Support SpotBugs and ErrorProne
- Errors in lambdas are not matched my method expressisons
- Codebase is empty using Gradle HOT 5
- use plantUML as rule source
- allow saving current state of violations and ignore it
- Split code-assert into several modules HOT 3
- Kotlin Multiplatform Gradle project layout support
- Document additional use-cases HOT 1
- Update ktlint to 0.39.0
- NoClassDefFound error while running example code
- Update JaCoCo to 0.8.8
- Failure when having rules on a package that only contains packages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from code-assert.