Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.
- What's New
- Function Overview
- Service Overview
-
Getting Started
- Building with Ant and Uploading the Package to a Release Repo (x86, Preset Image, GUI)
- Building with CMake and Uploading the Package to a Release Repo (Arm, Preset Image, GUI)
- Building with Maven, Uploading the Software Package, and Pushing the Image (x86, Preset Image, Code)
- Common Practices for Beginners
-
User Guide
- Working with CodeArts Build
- Enabling CodeArts Build
- Configuring Project-Level Role Permissions
- Creating a Build Task
-
Configuring a Build Task
- Performing Basic Configurations
- Selecting Build Actions
-
Configuring Build Actions
- Building with Maven
- Building with Android
- Building with npm
- Building with Gradle
- Building with Yarn
- Building with Gulp
- Building with Grunt
- Building with Mono
- Building in PHP
- Building with Setuptools
- Building with PyInstaller
- Running Shell Commands
- Building with GNU Arm
- Building with CMake
- Building with Ant
- Building with Kotlin
- Building with Go
- Building Android App with Ionic
- Building an Android Quick App
- Building with sbt
- Building with Grails
- Building with Bazel
- Building with Flutter
- Building with HarmonyOS
- Running Docker Commands to Operate Images
- Generating a Unit Test Report
- Customizing a Build Environment
- Using a Custom Build Environment
- Downloading a Software Package from Release Repos
- Uploading a Software Package to Release Repos
- Uploading Files to OBS
- Configuring Parameters
- Configuring Schedules
- Configuring Roles and Permissions
- Configuring Notifications
- Running a Build Task
- Viewing a Build Task
- Managing Build Tasks
- Querying Audit Logs
- References
- Old User Guide
-
Best Practices
- Creating a Docker Image with a Maven Artifact and Pushing the Image to SWR (Built-in Executors, GUI)
- Building with Maven and Uploading the Software Package to the Self-hosted Repo (Built-in Executors, GUI)
- Building with Maven to Generate a Private Dependency for Another Build (Built-in Executors, GUI)
- Building with npm and Uploading the Software Package to the Release Repo (Built-in Executors, GUI)
- Building with Maven (Custom Executors, GUI)
- Building with Maven, Uploading the Software Package, and Pushing the Image to SWR (Built-in Executors, Code)
- Running a Multi-Task Maven Build Project (Built-in Executors, Code)
- Using the File from the Self-hosted Repo to Build with Maven and Uploading the Resulting Software Package (Built-in Executors, GUI)
- Running a Build Task on a Custom Environment (Built-in Executors, GUI)
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
Task APIs
- Querying Build History in a Specified Period
- Querying Build History
- Downloading the Keystore File
- Viewing Task Status
- Querying Build Tasks in a Project
- Running a Build Task
- Querying the Latest Successful Build with a Specified Code Repository
- Querying Details of a Build Record
- Querying Success Rate of a Build Task in a Specified Period
- Downloading All Build Logs
- Downloading Logs of Build Actions
- Obtaining Information About Build Records
- Obtaining Details About Build Results
- Stopping a Build Task
- Deleting a Build Task
- Disabling a Build Task
- Restoring a Build Task
- Creating a Build Task
- Updating a Build Task
- Querying a Build Template
- Creating a Build Template
- Deleting a Build Template
- Querying Notifications
- Updating Notifications
- Canceling Notifications
- Obtaining Build Task Details
- Downloading Real-time Build Logs
- Obtaining Build Records of a Task
- CodeArts Build (Unavailable Soon)
- Application Examples
- Appendix
- Change History
-
FAQs
-
General
- Can I Run a Build Task with a Specific Server or Server Configuration?
- Why Are the Required Project Files Not Found During Builds?
- Files Not Found During Software Package Upload
- Why Am I Prompted that My Permissions Are Insufficient When Running a Build Task?
- Why Am I Prompted that the Build Task Does Not Exist When Calling It Through a Pipeline?
- Why Is My Task Stopped?
- How Do I Migrate Common Java Projects Created with Eclipse to the Cloud?
- Service Endpoint Did Not Exist
- Incomplete JAR Due to Parallel Build Tasks
- How Do I Resolve the Error Occurred When Pulling the Sub-module During My Build?
- How Do I Fix the Submodules Checkout Error Due to a Failure to Obtain Its Revision?
- Why Are the Submodules Not Being Pulled During My Build?
-
Maven Builds
- What Can I Do If License Check Fails?
- Failed to Upload a Package Using the maven deploy Command
- How Do I Deal With the Missing POM File?
- How Do I Deal With the Missing Package or Symbol?
- Using the exec-maven-plugin Extension for Maven and NPM Hybrid Builds
- How Do I Fix the Errors Related to References Among Multiple Child and Parent Projects?
- How Do I Configure and Clear the Cache for a Maven Build?
- How Do I Find the Correct Build Package Path?
- How Do I Use jib-maven-plugin to Build a Maven Project and Create an Image?
- Why Is the New Package Still Built from the Old Code Even After the Code Has Been Updated?
- Why Is My Download of Maven Components Slow?
-
Android Builds
- How Do I Deal With the Unstable Jcenter () Configured for a Project?
- What Should I Do If an Error Occurs During the Lint Check and the Task Stops?
- What Should I Do When Dependency com.android.tools.build:gradle:3.0.1 Cannot Be Downloaded?
- Why Am I Seeing the Error Message "Javadoc generation failed"?
- Why Am I Seeing the Error Message "Could not find method google()"?
- What Can I Do If the Gradle Version Is Too Early?
- How Do I Fix the Android APK Signing Failure?
- Using Gradle for Build
-
npm Builds
- Why Am I Seeing the Error Message "JavaScript heap out of memory"?
- Why Am I Seeing the Error Message "enoent ENOENT: no such file or directory"?
- Why Am I Seeing the Error Message "Module not found: Error: Can't resolve ..."?
- Why Did My Build Fail Without Displaying Any Errors?
- Why Am I Seeing the Error Message "npm cb() never called"?
- Why Am I Seeing the Error Message "gyp ERR!"? stack Error: EACCES: permission denied
- Why Am I Seeing the Error Message "eslint: error 'CLODOP' is not defined"?
- How Do I Fix the node-sass Download Failure?
- Why Am I Seeing the Error Message "error: Could Not Write Config File"?
- Why Does It Take Long to Install Dependencies and Build?
- What Should I Do When the Dependency Version Cannot Be Found?
-
Images
- Failed to Create an Image Using Dockerfile
- Failed to Push Images to SWR
- How Do I Resolve the Image Pull Failure During a Build Task?
- No Permission to Pull Images When SWR Public Images Are Used
- Failed to Log In to the Image Repository
- How Do I Push an Image to Other Tenants?
- Pulling Docker Hub Images Times Out or Exceeds the Max. Attempts
-
General
- Videos
- General Reference
Copied.
How Do I Deal With the Missing Package or Symbol?
Symptoms
When Maven build task is executed, an error message is displayed, indicating that the package or symbol cannot be found. For example:
com/xxx/xxx/configserver/encryptor/xxx.java:[11,40] package com.sun.jersey.api.client.config does not exist
Cause Analysis
According to the log, the project references the com.sun.jersey.api.client.config package. However, the package cannot be found in the project or all parsed dependency packages. The problem lies either in the code or the environment/component:
- Code problem: The package reference in the code is incorrect. In this case, check the code to solve the problem.
- Environment/Component problems: The dependency package is damaged or inconsistent. This type of problem is usually accompanied by successful native compilation with failed build in the cloud. The following sections provide solutions to solve different types of environment or component problems:
Dependency Package Conflict
Sometimes, multiple versions of the same dependency exist in a project due to misoperation or third-party dependency imports. This will make the used version different from the required version, and as a result the specified package cannot be found. To solve this problem, perform the following steps:
- Use either of the following methods to check the version of the dependency package:
- Maven resolves dependency conflicts with the following strategies:
- Nearest wins: For example, when building A, two dependencies exist: A > B > C > X 1.0 and A > D > X 2.0. Then X 2.0 will be used because the path from A to X through D is shorter.
- First declaration wins: If two dependency versions are at the same depth, the first declaration wins.
2. Use the Maven Dependency Plugin and run the mvn dependency:tree command in the build task.
- Maven resolves dependency conflicts with the following strategies:
- If the build fails because the dependency version is not the required version, import the required dependency at the outermost layer of the POM and try again.
<dependencies> <dependency> <groupId></groupId> <artifactId></artifactId> <version></version> </dependency> </dependencies>
Incorrect Dependency Range
In Maven, the dependency scope attribute specifies the visibility of a dependency. If the dependency scope is incorrectly specified, the dependency will be invalid during compilation. If the package in the dependency is used in the main code of the project, a compilation error will occur. Perform the following steps to solve the problem.
- Run the mvn dependency:tree command to view the dependency and dependency scope used by the project.
- Compare the dependency scope and the location where the dependency is used in the project.
If the package in the dependency is used in the main code and the dependency must be valid during builds, the dependency scope must be one of the following options:
- compile
- provided
- system: The location of the dependency file is specified in systemPath. The package must exist in the specified directory.
Dependency Package Uploaded Using GAV
- When uploading a dependency package to self-hosted repos using the groupId, artifactId, and version (GAV), you only need to upload the JAR package. The POM file will be generated automatically, but only contains the identifiers of the dependency. The original <dependencies> details will be lost.
- For example, assume that you use dependency A, which is built through project A, for building project D. Dependency A contains a third-party dependency, B. The dependency relationships are: D > A > B. When parsing dependency A, Maven will not be able to identify dependency B. As a result, project D cannot find contents in dependency B. In this case, perform the following steps:
- Check the dependency tree of project D and check whether the missing content is introduced by the POM file of project A. If yes, go to the next step. If no, try other solutions.
- Download the POM file of dependency A from the self-hosted repo of CodeArts Artifact and compare it with the POM file of project A. If the downloaded file does not contain the content introduced by B, go to the next step. Otherwise, try other solutions.
- Update the version of dependency A and upload it again using either of the following methods:
- Build project A in CodeArts Build. Run the deploy command to upload dependency A to the private Maven repository. You can use the pipeline for automation.
- Upload dependency A to the private Maven repository again. This time, upload the JAR packages and POM files separately.
- Build project D again.
Damaged Dependency Package
If the dependency package is damaged, some files in the package may be missing. As a result, the required dependency package can be found during a build, but the CLASS file or package cannot be found. The solution varies by the package type:
- Third-party dependency package: Contact technical support.
- Self-developed package (manually uploaded to the private Maven repository): Perform the following procedure.
- Download the dependency package from the private Maven repository.
- Decompress the package and check whether the content is normal.
- If the content of the dependency package is abnormal, perform either of the following steps:
- If the package is provided by a third party and manually uploaded to the private Maven repository, ensure that the package file is correct and upload the package again. (Note that both the POM and JAR files must be uploaded.)
- If the dependency package is built by yourself (on premises or in the cloud) and the code is correct, check whether the JAR package is incomplete because multiple build tasks run in parallel.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot