Comments (5)
In /kieker-monitoring/build.gradle
the dependency to kieker-common
is included two times:
dependencies {
implementation project(':kieker-common')
// ...
testImplementation project (path: ':kieker-common', configuration: 'testArchives')
// ...
}
This is no problem when dependencies are included as libraries. (When you close the project kieker-common
, Gradle builds the two JAR files which then can be properly referenced by Eclipse.)
But as a project dependency Eclipse supports only one reference to the same project. You could remove the additional test dependency from the classpath when kieker-common
is included as a project dependency by adding this to /kieker-monitoring/build.gradle
:
plugins {
id 'java'
id 'java-library'
id 'eclipse'
}
//...
eclipse {
classpath {
file {
whenMerged { classpath ->
classpath.entries.removeAll { entry ->
entry instanceof org.gradle.plugins.ide.eclipse.model.ProjectDependency
&& entry.path == '/kieker-common'
&& entry.entryAttributes['test']
}
}
}
}
}
Now, non-test dependencies from project kieker-monitoring
to kieker-common
are resolved.
By default, test sources from one Eclipse project are not exposed to other projects (visualized by without test code in the project explorer). To expose the test classes, add this to /kieker-common/build.gradle
:
plugins {
id 'java'
id 'eclipse'
}
// ...
eclipse {
classpath {
containsTestFixtures = true
}
}
See also #1206
from buildship.
Thanks for the hint. For kieker-common
and kieker-monitoring
, it works to include the whenMerged
definition to the classpath.
Just closing the project unfortunately does not work:
Unfortunately, Kieker contains more modules, and for kieker-analysis
, it does not work (I've uploaded the partial fix in https://github.com/kieker-monitoring/kieker/tree/KIEKER-1966-2). Here, we have the same situation with two references to kieker-common
, one of them being its testArchives: https://github.com/kieker-monitoring/kieker/blob/bcb811d0cd8a58d2baa4e5d684c35f5f6e0ca6f7/kieker-analysis/build.gradle#L58 This is not recognized correctly, even with the containsTextFixture
in /kieker-common/build.gradle
and the whenMerged
both in /kieker-monitoring/build.gradle
and /kieker-analysis/build.gradle
:
Additionally, it seems like the teetime
dependencies are not correctly identified: https://github.com/kieker-monitoring/kieker/blob/bcb811d0cd8a58d2baa4e5d684c35f5f6e0ca6f7/kieker-analysis/build.gradle#L62 which results in test classes of teetime being missing:
This suprises me, since compiling Kieker works fine with just Gradle, but in eclipse, its not possible to build (and I'm sure it worked a year ago - but since I've updated eclipse, it neither works with the currenct nor with older eclipse versions).
from buildship.
With your changes I can see no more problems in kieker-analysis
.
With commit https://github.com/oleosterhagen/kieker/commit/48be0261cf4edb247fc736d5c4cd2801e87cb0a9 I have completed the configuration. The Gradle project should now import without compile errors. (Unfortunately the Java builder picks some files in /kieker-monitoring/test-resources
. But this a different issue.)
In some places two project dependencies must be taken into account:
[...]
classpath.entries.removeAll { entry ->
entry instanceof org.gradle.plugins.ide.eclipse.model.ProjectDependency
&& ['/kieker-common', '/kieker-tools'].contains(entry.path)
&& entry.entryAttributes['test']
}
When you still have problems and the invocation of Gradle > Refresh Gradle Project does not help, you can try these steps:
- Remove the projects from the Eclipse workspace
- Delete all
.classpath
and.project
files and all.settings
folders - Import the Gradle project again in Eclipse
from buildship.
Thanks a lot for the fix! The described problem is fixed by your commit, and we additionally fixed the test-resources problem, so with kieker-monitoring/kieker#419, Kieker is fully buildable with eclipse again.
from buildship.
@DaGeRe Thank you for your feedback and closing the issue.
When I have some more time, I will try to improve Gradle so that this case is better supported and does not need a manual adjustment of the classpath.
from buildship.
Related Issues (20)
- Launch Group that runs gradle task with the post launch action set to wait for termination waits infinitely
- Update site pages incorrect in the user documentation HOT 4
- deadlock during startup HOT 8
- Use preferences to decide if tabs or spaces are used in build script editor
- [Mac] After update on Eclipse version 09.2023 Splash Screen upside down HOT 2
- Kotlin Language server does not work on Windows
- The 3.1.8 release does not exist but a new release is needed for SimRel HOT 1
- Please ship org.gradle.toolingapi source jar in p2 repo
- An internal error occurred during: "Install semantic highlighting". HOT 1
- Problems building java17 projects with Buildship 3.1.8 and Eclipse 202312 HOT 5
- Importing java-library builds via "Projects from Folder or Archive" does not work correctly
- Marker Property value is too long
- Gradle tasks fail to load upon Eclipse start, manual refresh works as expected HOT 2
- 'files' dependencies should be added to the module path when applicable
- Improve Eclipse refresh time
- Finish button grayed out when importing a Gradle Project using Java 1.8,0_401
- Caused by: BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 66 HOT 4
- Importing https://github.com/open-telemetry/opentelemetry-java doesn't create Eclipse projects
- Setup a chatroom in chat.eclipse.org for the community HOT 1
- The "Refresh Gradle Project" command does not reload .settings/org.eclipse.jdt.apt.core.prefs
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 buildship.