joern-php environment problem(when I use grdle build) - gradle

php-joern is a tool to analyse php project,to get the code please call on "https://github.com/aalhuz/phpjoern"
but I've got some problems
first i can use php-ast to get the codes'ast successfully,but when i try to use the php-cpg,it failed.
The command where I made a mistake is "grdle build",when i use "grdle build",it reminds me the information as follows
'''
Download https://repo.maven.apache.org/maven2/org/neo4j/neo4j-graph-algo/2.1.8/neo4j-graph-algo-2.1.8.jar
warning: Supported source version 'RELEASE_7' from annotation processor 'org.neo4j.kernel.impl.annotations.ServiceProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.neo4j.kernel.impl.annotations.DocumentationProcessor' less than -source '1.8'
Note: /home/zyp/joern/projects/extensions/joern-fuzzyc/src/main/java/neo4j/readWriteDB/Neo4JDBInterface.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 warnings
:projects:extensions:joern-fuzzyc:processResources NO-SOURCE
:projects:extensions:joern-fuzzyc:classes
:projects:extensions:joern-fuzzyc:jar
:projects:extensions:joern-fuzzyc:assemble
:projects:extensions:joern-fuzzyc:compileTestJavawarning: Supported source version 'RELEASE_7' from annotation processor 'org.neo4j.kernel.impl.annotations.ServiceProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.neo4j.kernel.impl.annotations.DocumentationProcessor' less than -source '1.8'
2 warnings
:projects:extensions:joern-fuzzyc:processTestResources NO-SOURCE
:projects:extensions:joern-fuzzyc:testClasses
:projects:extensions:joern-fuzzyc:test
tests.ddg.testDDGCreator > simplestTest FAILED
java.util.NoSuchElementException at testDDGCreator.java:33
tests.ddg.testDDGCreator > testConverter FAILED
java.util.NoSuchElementException at testDDGCreator.java:55
tests.argumentTainter.TestArgumentTainter > testDefUseCFGPatcher FAILED
java.util.NoSuchElementException at TestArgumentTainter.java:65
137 tests completed, 3 failed
:projects:extensions:joern-fuzzyc:test FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':projects:extensions:joern-fuzzyc:test'.
There were failing tests. See the report at: file:///home/zyp/joern/projects/extensions/joern-fuzzyc/build/reports/tests/test/index.html
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 20m 38s
19 actionable tasks: 19 executed
'''
I really hope someone could help me.Thank you very much.

Related

Gradle 7.2 Tar task baseName deprecated but replacement archiveBaseName is rejected

I have started using Gradle 7.2 to build a project that produces a compressed Tar archive. Gradle is issuing a deprecation warning that baseName is deprecated and should be replaced with archiveBaseName. But it rejects archiveBaseName.
A very much simplified example using a trivial Gradle build script, with their associated execution outputs are given below. I did run 'gradle --stop' to ensure a prior version's daemon wasn't actually executing; a GRADLE_HOME environment variable is pointing to the correct Gradle folder (not sure it's needed, but it is set.)
I tried using "archiveBaseName" both without and with "=" ("archiveBaseName 'Test'" and "archiveBaseName='Test'").
The docs seem to suggest archiveBaseName should already be available, so I don't think it's just a heads up of things to come.
Thank you!
Gradle file:
task dist(type: Tar) {
baseName 'Test'
into ('.') { from('.') }
}
Execution:
gradle build --warning-mode=all
c:\jdev\newpaas\xxx>gradle build --warning-mode all
> Configure project :
The AbstractArchiveTask.baseName property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the archiveBaseName property instead. See https://docs.gradle.org/7.2/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchiveTask:baseName for more details.
at build_2qa2gx0itzunotwyc4ndf9v86$_run_closure1.doCall(C:\jdev\newpaas\xxx\build.gradle:2)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
> Task :buildEnvironment
------------------------------------------------------------
Root project 'TestProject'
------------------------------------------------------------
classpath
No dependencies
A web-based, searchable dependency report is available by adding the --scan option.
BUILD SUCCESSFUL in 983ms
1 actionable task: 1 executed
Gradle file:
task dist(type: Tar) {
archiveBaseName 'Test'
into ('.') { from('.') }
}
Execution:
c:\jdev\newpaas\xxx>gradle build --warning-mode all
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\jdev\newpaas\xxx\build.gradle' line: 2
* What went wrong:
A problem occurred evaluating root project 'TestProject'.
> Could not find method archiveBaseName() for arguments [Test] on task ':dist' of type org.gradle.api.tasks.bundling.Tar.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Gradle file:
task dist(type: Tar) {
archiveBaseName='Test'
into ('.') { from('.') }
}
Execution:
c:\jdev\newpaas\xxx>gradle dist
> Task :dist FAILED
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':dist' (type 'Tar').
- Type 'org.gradle.api.tasks.bundling.Tar' property 'archiveFile' doesn't have a configured value.
Reason: This property isn't marked as optional and no value has been configured.
Possible solutions:
1. Assign a value to 'archiveFile'.
2. Mark property 'archiveFile' as optional.
Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#value_not_set for more details about this problem.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
1 actionable task: 1 executed
I stumbled across this syntax and it seems to be working for me:
archiveFileName = "${archiveBaseName}-${archiveVersion}.${archiveExtension}"

Flutter image_picker not working with flutter_plugin_android_lifecycle issue

I have followed all the steps to implement the image picker plugin in a fresh new app.
Added dependencies to pubspec.yaml
dependencies:
image_picker: 0.6.2+3
Added to the menifest
android:requestLegacyExternalStorage="true"
Followed the example code, But I am getting is this error..
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
../project/android/app/src/main/AndroidManifest.xml:9:5-53:19: AAPT: error: attribute android:requestLegacyExternalStorage not found.
and
/Users/.../Documents/_sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-1.0.8/android/src/main/java/io/flutter/embedding/engine/plugins/lifecycle/FlutterLifecycleAdapter.java:8: error: package androidx.lifecycle does not exist
import androidx.lifecycle.Lifecycle;
^
/Users/.../Documents/_sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-1.0.8/android/src/main/java/io/flutter/embedding/engine/plugins/lifecycle/FlutterLifecycleAdapter.java:22: error: cannot find symbol
public static Lifecycle getActivityLifecycle(
^
symbol: class Lifecycle
location: class FlutterLifecycleAdapter
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Exception: The plugin flutter_plugin_android_lifecycle could not be built due to the issue above.
Whats the wrong am I doing here!
After an intensive search, i got the clue to solved this issue. The app need to compile against SDK 29, which is the latest buildTool includes the latest changes that were introduced in Android 10.
Inside app level build.gradle file
// ...
android {
compileSdkVersion 29
// ....
defaultConfig {
targetSdkVersion 29
//...
I think this should be mentioned in the image_picker documentation.

Unable to excute bootJar task when compile/implementation anthoer project

What happened when excute bootJar or run:
> Task :common:compileJava
> Task :common:processResources NO-SOURCE
> Task :common:classes
> Task :common:jar SKIPPED
> Task :api:compileJava FAILED
D:\workspace\IDEA\bootar\api\src\main\java\com\sample\Application.java:3:
����: �����com.sample.common������// looks like package or class not found.
import com.sample.common.CommonClazz;
^
D:\workspace\IDEA\bootar\api\src\main\java\com\sample\Application.java:23:
����: �Ҳ�������
public CommonClazz test() {
^
����: �� CommonClazz
�: �� Application
2 ������
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':api:compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
2 actionable tasks: 2 executed
Actually, the project itself is very simple:
and the gradle files:
The IDE could find CommonClazz and import it into Application, but when I try to run or build the api module, it failed.
I'm using:
IntelliJ IDEA 2019.2 EAP (Ultimate Edition)
Build #IU-192.5587.17, built on July 3, 2019
Runtime version: 11.0.3+12-b304.10 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 1270M
Cores: 4
Registry: debugger.watches.in.variables=false, git.explicit.commit.renames.prohibit.multiple.calls=false
Non-Bundled Plugins: Key Promoter X, Lombook Plugin, Property Sorter, cn.yiiguxing.plugin.translate, mobi.hsz.idea.gitignore, GradleDependenciesHelper, com.vladsch.idea.multimarkdown
spring-boot-gradle-plugin:2.1.6.RELEASE
springCloudVersion Greenwich.SR1

Converting maven to gradle of Spring Initializr

Spring Initializr is a open source project , which can be downloaded/cloned from github to run our own spring initializr. however the build of the project is maven. I want to convert it to gradle. Can anyone Help ?
I tried it with gradle init and gradle build
Gradle init is creating build.gradle and settings.gradle but gradle build is giving error.
Can someone try and post the solution
Thanks in advance
Error Details :
Task :initializr-actuator:compileTestJava FAILED
D:\Duplicate1\initializr\initializr-actuator\src\test\java\io\spring\initializr\actuate\ActuatorIntegrationTests.java:19: error: package io.spring.initializr.web does not exist
import io.spring.initializr.web.AbstractFullStackInitializrIntegrationTests;
^
D:\Duplicate1\initializr\initializr-actuator\src\test\java\io\spring\initializr\actuate\ActuatorIntegrationTests.java:35: error: cannot find symbol
extends AbstractFullStackInitializrIntegrationTests {
^
symbol: class AbstractFullStackInitializrIntegrationTests
D:\Duplicate1\initializr\initializr-actuator\src\test\java\io\spring\initializr\actuate\info\BomRangesInfoContributorTests.java:24: error: package io.spring.initializr.test.metadata does not exist
import io.spring.initializr.test.metadata.InitializrMetadataTestBuilder;
^
D:\Duplicate1\initializr\initializr-actuator\src\test\java\io\spring\initializr\actuate\metric\ProjectGenerationMetricsListenerTests.java:28: error: package io.spring.initializr.test.metadata does not exist
import io.spring.initializr.test.metadata.InitializrMetadataTestBuilder;
^
D:\Duplicate1\initializr\initializr-actuator\src\test\java\io\spring\initializr\actuate\stat\AbstractInitializrStatTests.java:23: error: package io.spring.initializr.test.metadata does not exist
import io.spring.initializr.test.metadata.InitializrMetadataTestBuilder;
^
D:\Duplicate1\initializr\initializr-actuator\src\test\java\io\spring\initializr\actuate\stat\MainControllerStatsIntegrationTests.java:24: error: package io.spring.initializr.web does not exist
import io.spring.initializr.web.AbstractFullStackInitializrIntegrationTests;
^
D:\Duplicate1\initializr\initializr-actuator\src\test\java\io\spring\initializr\actuate\stat\MainControllerStatsIntegrationTests.java:56: error: cannot find symbol
extends AbstractFullStackInitializrIntegrationTests {
^
symbol: class AbstractFullStackInitializrIntegrationTests
7 errors
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':initializr-actuator:compileTestJava'.
Compilation failed; see the compiler error output for details.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 4s
11 actionable tasks: 1 executed, 10 up-to-date
Instead of converting that you can generate fresh project from following url:
https://start.spring.io/
Select Gradle Project and download the code.

Problems using NetBeans 8.2 and Gradle to compile clarifai-java-master

I am trying to compile clarifai-java-master with Gradle and NetBeans 8.2 (JDK 1.8), but it fails. The log is below.
Could anyone help me, please?!
Thanks!
-------------
Executing: gradle clean build
Arguments: [-c, K:\D\Dados\GitHubProjects\clarifai-java-master\settings.gradle]
:core:clean
:tests:clean
:core:generateBuildConfig
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
:core:compileBuildConfig
warning: [options] bootstrap class path not set in conjunction with -source 1.7
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:core:compileJava
:core:processResources UP-TO-DATE
:core:classes
:core:jar
K:\D\Dados\GitHubProjects\clarifai-java-master\core\src\main\java\clarifai2\dto\model\ConceptModel.java:20: warning: no #return
public final PatchModelRequest mergeConcepts() {
^
K:\D\Dados\GitHubProjects\clarifai-java-master\core\src\main\java\clarifai2\dto\model\ConceptModel.java:28: warning: no #return
public final PatchModelRequest setConcepts() {
^
K:\D\Dados\GitHubProjects\clarifai-java-master\core\src\main\java\clarifai2\dto\model\ConceptModel.java:36: warning: no #return
public final PatchModelRequest removeConcepts() {
^
:core:javadoc
3 warnings
:core:javadocJar
:core:sourcesJar
:core:signArchives SKIPPED
:core:assemble
:core:compileTestJava UP-TO-DATE
:core:processTestResources UP-TO-DATE
:core:testClasses UP-TO-DATE
:core:test UP-TO-DATE
:core:check UP-TO-DATE
:core:build
:tests:compileJava UP-TO-DATE
:tests:processResources UP-TO-DATE
:tests:classes UP-TO-DATE
:tests:jar
:tests:javadoc UP-TO-DATE
:tests:javadocJar
:tests:sourcesJar
:tests:assemble
FAILURE: Build failed with an exception.
What went wrong:
Could not resolve all dependencies for configuration :tests:testCompileClasspath.
Unexpected state Evicted for parent node for dependency from com.clarifai.clarifai-api2:core:unspecified.dirty(default) to com.squareup.okhttp3:okhttp:3.4.1(default).
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
:tests:compileTestJava
BUILD FAILED
Total time: 15.576 secs
Build failure (see the Notifications window for stacktrace): gradle clean build
I've just solved the dependencies problems adding this line:
compile "com.clarifai.clarifai-api2:core:2.2.0"
... in the dependencies sections of two files:
- build-gradle(core) and
- build-gradle(test):
... and Reload Project for core and test.

Resources