Skip to content
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

Incomplete list of supported goals #20

Open
a-a-davydov opened this issue Jun 11, 2021 · 4 comments
Open

Incomplete list of supported goals #20

a-a-davydov opened this issue Jun 11, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@a-a-davydov
Copy link

a-a-davydov commented Jun 11, 2021

Hello,

It seems list of goals to activate plugin in class AbstractMojo incomplete.

It is impossible to run mvn ... maven-deploy-plugin ..., maven understand only org.apache.maven.plugins:maven-deploy-plugin:deploy or deploy:deploy goals when we need to run exactly deploy directly.

So in current version we can use artifactory plugin only with goal 'deploy'

@mojo(name = "publish", defaultPhase = LifecyclePhase.VALIDATE, threadSafe = true)public class ArtifactoryMojo extends AbstractMojo { private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); private static final String[] DEPLOY_GOALS = {"deploy", "maven-deploy-plugin"};
@a-a-davydov a-a-davydov added the bug Something isn't working label Jun 11, 2021
@a-a-davydov
Copy link
Author

Old version contains following check logic

final isDeployGoal = deployGoals.tokenize( ',' )*.trim().any {            String deployGoal -> session.goals.any {            String goal      -> (( goal == deployGoal ) || goal.contains( deployGoal ))            }        }

So old version check if goals list contains goal which contains maven-deploy-plugin

New code checks if goals list contains maven-deploy-plugin exactly:

 return session.getGoals().stream().anyMatch(goal -> ArrayUtils.contains(DEPLOY_GOALS, goal));

@a-a-davydov
Copy link
Author

a-a-davydov commented Jun 11, 2021

Seems valid list must be

String[] DEPLOY_GOALS = {"deploy", "deploy:deploy"}

@long76
Copy link

long76 commented Dec 11, 2023

+1 here

@long76
Copy link

long76 commented Dec 11, 2023

last version with worked with deployGoals is 2.6.1 but it's works only with Maven 3.8.x not 3.9.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants