-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double execution of the "car" goal from maven-car-plugin #34
Comments
Hi @gspadotto, We will analyze the bug and get back to you as soon as possible. Best regards, |
Hi @DedunuKarunarathne |
Hi @gspadotto, Do you use Integration Studio or Archetype to generate your project? If it's through Integration Studio, we may need to apply a fix to the Studio's Java code. Otherwise, we can consider making adjustments directly to the archetype. Thanks, |
Hi @IsuruMaduranga, |
Hi @gspadotto, Integration Studio does not use this archetype. Thanks, |
Hi @gspadotto, Until we release an updated version, you can bypass the described issue by temporarily disabling the following XML block in the <executions>
<execution>
<id>car</id>
<phase>package</phase>
<goals>
<goal>car</goal>
</goals>
</execution>
</executions> To facilitate this modification in a CI/CD pipeline, I've prepared a sample shell script that automates the process. Please feel free to adjust it according to your needs: #!/bin/bash
# Define the file path
FILE_PATH="pom.xml"
# Check if xmlstarlet is installed
if ! command -v xmlstarlet &> /dev/null
then
echo "xmlstarlet could not be found. Please install it to run this script."
exit 1
fi
# Check if the file exists
if [ ! -f "$FILE_PATH" ]; then
echo "File not found: $FILE_PATH"
exit 1
fi
# Backup the original file
cp $FILE_PATH "${FILE_PATH}.bak"
# Command to remove the specific executions block
xmlstarlet ed -N x="http://maven.apache.org/POM/4.0.0" \
-d "//x:project/x:build/x:plugins/x:plugin[x:artifactId='maven-car-plugin']/x:executions/x:execution[x:id='car']" \
$FILE_PATH > $FILE_PATH.mod
# Check for modifications and replace the original file if changes have been made
if cmp -s "$FILE_PATH" "$FILE_PATH.mod"
then
echo "No changes made."
rm "$FILE_PATH.mod"
else
mv "$FILE_PATH.mod" "$FILE_PATH"
echo "Executions block removed successfully."
fi Thank you, |
Hi @IsuruMaduranga Please refer to this issue in the PR that will fix it so that we can get notifications. |
@GDLMadushanka I would not close this issue as "complete" until these lines from the CompositeExporter archetype are removed: The changes in wso2/integration-studio@2b9f7b5 only fix the problem when using Integration Studio. |
Description:
The following lines in the CompositeExporter archetype cause the "package" phase to be executed twice:
https://github.com/wso2-extensions/archetypes/blob/master/esb-project-archetype/src/main/resources/archetype-resources/__rootArtifactId__CompositeExporter/pom.xml#L77-L85
This is because the "car" goal from maven-car-plugin is already configured for the "package" phase in the default lifecycle:
https://github.com/wso2/maven-tools/blob/v5.2.34/maven-car-plugin/src/main/resources/META-INF/plexus/components.xml#L35
Suggested Labels:
bug
Suggested Assignees:
pamodaaw
Affected Product Version:
From 2.0.17:
09c6383#diff-99ecab20addd5e5942e6a7616a1883a3f5e7c504c9849f5cf7b4ec25d01f6556
Steps to reproduce:
Generate an Integration Project, move to the XXXXCompositeApplication folder, run:
mvn package
See that the "car" goal is executed twice, once with (default-car) and once with (car).
Alternatively, execute from the same folder the following command:
mvn buildplan:list
And see that the output is like the one below:
Related Issues:
wso2/maven-tools#118
The text was updated successfully, but these errors were encountered: