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

Ivy main/standalone: Patch to include 'makepom' function #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ test/repositories/norevision/ivy-mod1.1.xml
test/repositories/norevision/mod1.1.jar
test/test-repo/bundlerepo/*.jar
test/test-repo/ivyrepo/org.apache.ivy.osgi
out/
10 changes: 10 additions & 0 deletions src/java/org/apache/ivy/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
import org.apache.ivy.core.resolve.ResolveProcessException;
import org.apache.ivy.core.retrieve.RetrieveOptions;
import org.apache.ivy.core.settings.IvySettings;
import org.apache.ivy.plugins.parser.m2.PomModuleDescriptorWriter;
import org.apache.ivy.plugins.parser.m2.PomWriterOptions;
import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorWriter;
import org.apache.ivy.plugins.report.XmlReportParser;
import org.apache.ivy.util.DefaultMessageLogger;
Expand Down Expand Up @@ -199,6 +201,10 @@ static CommandLineParser getParser() {
new OptionBuilder("cp").arg("cp")
.description("extra classpath to use when launching process").create())

.addCategory("maven compatibility options")
.addOption(new OptionBuilder("pomfile").arg("pomfile").countArgs(false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small suggestion - can you change this to something like:

new OptionBuilder("makepom").arg("pomfile")....

.description("makepom as standalone tasks").create())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the description should be a bit more clear and state that this generates a pom file for the resolved module.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO pomfile is confusing (cf use of ivyfile and propertiesfile). I'd suggest writepomor something like that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the second thoughts, why not calling the option makepom 😉 ?


.addCategory("message options")
.addOption(
new OptionBuilder("debug").description("set message level to debug").create())
Expand Down Expand Up @@ -419,6 +425,10 @@ private static ResolveReport run(CommandLine line, boolean isCli) throws Excepti
.setOverwrite(line.hasOption("overwrite")));
}
}
if (line.hasOption("pomfile")) {
String pomFile = line.getOptionValue("pomfile", "pom.xml");
PomModuleDescriptorWriter.write(md, new File(pomFile), new PomWriterOptions());
}
if (line.hasOption("main")) {
// check if the option cp has been set
List<File> fileList = getExtraClasspathFileList(line);
Expand Down