Build artifacts within a child pipeline by using a shared component from another project

im building a pipeline which builds java applications.

im forced to use a component to build that package that has the maven image to build it, with predefined inputs of that component like java lts version, maven goal and jobname

Im trigerring it with a buildjob with the “trigger” keyword. I see the build log package the war file propperly within the log of buildjob. i need to pass the generated artifact from the child(component) to the pipelein

i need to get soehow that artifact and use another component wich i trigger in order to deploy it on a server which i also trigger in a job with the keyword “trigger” and here i need to pass the generated artifact to a deployment component wich im trigger and here i need to pass the artifact from the pipeline to the child(componen)

my question is that even possible in this fashion? unfortunatly i have to use these components to generate an artifact and deploy it.

this would be an simplified example of it:


stages:
  - build
  - deployment_parallel_central

.anhor_desired_java_version: &fixed_java_build_version
  jdk_version: '17'

.build_anchor_parameters: &build_parameters
  job_name: "mvn-build"
  <<: *fixed_java_build_version
  stage: build
  goals: 'package'

build_artifact_job:
  stage: "build"
  trigger: 
    include:
      - component: $CI_SERVER_FQDN/build@main
        inputs:
          *build_parameters
    strategy: depend


.deploy_to_server1_inputs: &deploy_to_server1_inputs
  job_name: "dep-server1"
  stage: deploy
  host_list: "myserver.com"
  server_list: "server1"


trigger_parallel_deployment_server1:
  stage: "deployment_parallel_central"
  trigger:
    include:
      - component: $CI_SERVER_FQDN/deploy@main
        inputs:
          *deploy_to_server1_inputs