ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sutchark <...@git.apache.org>
Subject [GitHub] ant-ivy issue #68: Why no new Ivy version yet?
Date Thu, 01 Mar 2018 21:39:31 GMT
Github user sutchark commented on the issue:

    https://github.com/apache/ant-ivy/pull/68
  
    I used the code below to download all dependencies. 
    
    You see the output at the very bottom. Here are the 13 direct compile dependencies it
should download: 
    https://mvnrepository.com/artifact/io.playn/playn-java-lwjgl/2.0
    
    It only downloads some OSX jars for lwjgl. Also the content of those jars is somehow wrong
when you open them.
    
    Here is the correct jar for content comparison: http://central.mav en.org/maven2/org/lwjgl/lwjgl/
3.1.2/lwjgl-3.1.2.jar
    
    Very confusing.
    
    
    The file ivy2.xml looks like this:
    
    `<ivy-module version="2.0">
     <info organisation="apache" module="hello-ivy"/>
     <dependencies>
           <dependency org="io.playn" name="playn-java-lwjgl" rev="2.0"/>
     </dependencies>
    </ivy-module>`
    
    `import java.io.File;
    import java.io.IOException;
    import java.text.ParseException;
    import java.util.List;
    
    import org.apache.ivy.Ivy;
    import org.apache.ivy.core.LogOptions;
    import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
    import org.apache.ivy.core.module.id.ModuleRevisionId;
    import org.apache.ivy.core.report.ResolveReport;
    import org.apache.ivy.core.retrieve.RetrieveOptions;
    import org.apache.ivy.core.settings.IvySettings;
    
    public class IvyApiExperiments {
    
    	public static void main(String[] args) throws ParseException, IOException {
    		IvySettings ivySettings = new IvySettings();
    		// Now let's set the basedir of the ivy settings to some location
    		File baseDir = new File(".");
    		System.out.println("baseDir: " + baseDir.getAbsolutePath());
    		ivySettings.setBaseDir(baseDir);
    		
    		// create an ivy instance
    		Ivy ivy = Ivy.newInstance(ivySettings);
    		
    		// That's where my ivy-settings.xml is located
    		File ivySettingsXmlFile = new File("./ivysettings.xml");
    		System.out.println(ivySettingsXmlFile.getAbsolutePath());
    		// configure ivy to use the settings file
    		ivy.configure(ivySettingsXmlFile);
    		
    		
    		
    		System.out.println("\n\n1. Define Dependencies\n\n");
    
    		// file containing the list of dependencies (ex: ivy.xml)
    //		File dependencyFile = new File("./ivy-2.0.xml");
    		File dependencyFile = new File("./ivy2.xml");
    		
    		
    		
    		System.out.println("\n\n2. Resolve Dependencies\n\n");
    		
    		// resolve the dependencies - Ivy returns a report of the resolution
    		ResolveReport resolveReport = ivy.resolve(dependencyFile);
    		
    		// check for errors (if any) during resolve
    		if (resolveReport.hasError()) {
    			List<String> problems = resolveReport.getAllProblemMessages();
    			if (problems != null && !problems.isEmpty()) {
    				StringBuffer errorMsgs = new StringBuffer();
    				for (String problem : problems) {
    					errorMsgs.append(problem);
    					errorMsgs.append("\n");
    				}
    				System.err.println("Errors encountered during dependency resolution for package :");
    				System.err.println(errorMsgs);
    			}
    		} else {
    			System.out.println("Dependencies in file " + dependencyFile + " were successfully resolved");
    		}
    		
    		
    		System.out.println("\n\n3. Retrieve Dependencies\n\n");
    		
    		// Now that the dependencies have been resolved, let now retrieve them
    		// Get the descriptor
    		ModuleDescriptor md = resolveReport.getModuleDescriptor();
    		// module revision id of the module whose dependencies were resolved
    		ModuleRevisionId mRID = md.getModuleRevisionId();
    		 
    		// options that we pass to ivy instance for retrieve the dependencies
    		RetrieveOptions retrieveOptions = new RetrieveOptions();
    		 
    		// folder to which we want the dependencies retrieved
    		File destFolder = new File("./retrieved");
    		 
    		// the Ivy pattern which will be used for retrieving the dependencies
    		String pattern = destFolder + "/[organization]/[module]/[type]/[artifact]-[revision].[ext]";
    		retrieveOptions.setDestIvyPattern(pattern);
    		 
    		// default logging option
    		retrieveOptions.setLog(LogOptions.LOG_DEFAULT);
    		 
    		// retrieve them!
    		int packagesRetrieved = ivy.retrieve(mRID, pattern, retrieveOptions);
    		 
    		System.out.println("Retrieved " + packagesRetrieved + " dependencies");
    	}
    	
    }
    `
    
    
    `:: resolving dependencies :: apache#hello-ivy
    	confs: [default]
    	found io.playn#playn-java-lwjgl;2.0 in public
    	found io.playn#playn-java-base;2.0 in public
    	found io.playn#playn-core;2.0 in public
    	found com.samskivert#pythagoras;1.4.3 in public
    	found com.threerings#react;1.5.3 in public
    	found com.googlecode.soundlibs#mp3spi;1.9.5-1 in public
    	found com.googlecode.soundlibs#jlayer;1.0.1-1 in public
    	found junit#junit;3.8.2 in public
    	found com.googlecode.soundlibs#tritonus-share;0.3.7-1 in public
    	found org.java-websocket#Java-WebSocket;1.3.0 in public
    	found org.lwjgl#lwjgl;3.1.2 in public
    	found org.lwjgl#lwjgl-opengl;3.1.2 in public
    	found org.lwjgl#lwjgl-glfw;3.1.2 in public
    downloading https://repo1.maven.org/maven2/io/playn/playn-java-lwjgl/2.0/playn-java-lwjgl-2.0-sources.jar
...
    ....... (14kB)
    .. (0kB)
    	[SUCCESSFUL ] io.playn#playn-java-lwjgl;2.0!playn-java-lwjgl.jar(source) (79ms)
    downloading https://repo1.maven.org/maven2/io/playn/playn-java-lwjgl/2.0/playn-java-lwjgl-2.0-javadoc.jar
...
    ................ (37kB)
    .. (0kB)
    	[SUCCESSFUL ] io.playn#playn-java-lwjgl;2.0!playn-java-lwjgl.jar(javadoc) (92ms)
    downloading https://repo1.maven.org/maven2/io/playn/playn-java-lwjgl/2.0/playn-java-lwjgl-2.0.jar
...
    ............. (31kB)
    .. (0kB)
    	[SUCCESSFUL ] io.playn#playn-java-lwjgl;2.0!playn-java-lwjgl.jar (95ms)
    downloading https://repo1.maven.org/maven2/io/playn/playn-java-base/2.0/playn-java-base-2.0.jar
...
    ................ (67kB)
    .. (0kB)
    	[SUCCESSFUL ] io.playn#playn-java-base;2.0!playn-java-base.jar (123ms)
    downloading https://repo1.maven.org/maven2/org/lwjgl/lwjgl/3.1.2/lwjgl-3.1.2-natives-macos.jar
...
    ................ (33kB)
    .. (0kB)
    	[SUCCESSFUL ] org.lwjgl#lwjgl;3.1.2!lwjgl.jar (109ms)
    downloading https://repo1.maven.org/maven2/org/lwjgl/lwjgl-opengl/3.1.2/lwjgl-opengl-3.1.2-natives-macos.jar
...
    .............. (43kB)
    .. (0kB)
    	[SUCCESSFUL ] org.lwjgl#lwjgl-opengl;3.1.2!lwjgl-opengl.jar (117ms)
    downloading https://repo1.maven.org/maven2/org/lwjgl/lwjgl-glfw/3.1.2/lwjgl-glfw-3.1.2-natives-macos.jar
...
    .............. (42kB)
    .. (0kB)
    	[SUCCESSFUL ] org.lwjgl#lwjgl-glfw;3.1.2!lwjgl-glfw.jar (115ms)
    downloading https://repo1.maven.org/maven2/io/playn/playn-core/2.0/playn-core-2.0.jar
...
    ...................... (172kB)
    .. (0kB)
    	[SUCCESSFUL ] io.playn#playn-core;2.0!playn-core.jar (178ms)
    downloading https://repo1.maven.org/maven2/com/googlecode/soundlibs/mp3spi/1.9.5-1/mp3spi-1.9.5-1.jar
...
    .............. (32kB)
    .. (0kB)
    	[SUCCESSFUL ] com.googlecode.soundlibs#mp3spi;1.9.5-1!mp3spi.jar (89ms)
    downloading https://repo1.maven.org/maven2/org/java-websocket/Java-WebSocket/1.3.0/Java-WebSocket-1.3.0.jar
...
    .................. (100kB)
    .. (0kB)
    	[SUCCESSFUL ] org.java-websocket#Java-WebSocket;1.3.0!Java-WebSocket.jar (131ms)
    downloading https://repo1.maven.org/maven2/com/samskivert/pythagoras/1.4.3/pythagoras-1.4.3.jar
...
    ............................................... (572kB)
    .. (0kB)
    	[SUCCESSFUL ] com.samskivert#pythagoras;1.4.3!pythagoras.jar (420ms)
    downloading https://repo1.maven.org/maven2/com/threerings/react/1.5.3/react-1.5.3.jar
...
    ...................... (164kB)
    .. (0kB)
    	[SUCCESSFUL ] com.threerings#react;1.5.3!react.jar (223ms)
    downloading https://repo1.maven.org/maven2/com/googlecode/soundlibs/jlayer/1.0.1-1/jlayer-1.0.1-1.jar
...
    .................... (135kB)
    .. (0kB)
    	[SUCCESSFUL ] com.googlecode.soundlibs#jlayer;1.0.1-1!jlayer.jar (181ms)
    downloading https://repo1.maven.org/maven2/com/googlecode/soundlibs/tritonus-share/0.3.7-1/tritonus-share-0.3.7-1.jar
...
    ......................... (215kB)
    .. (0kB)
    	[SUCCESSFUL ] com.googlecode.soundlibs#tritonus-share;0.3.7-1!tritonus-share.jar (213ms)
    downloading https://repo1.maven.org/maven2/junit/junit/3.8.2/junit-3.8.2.jar ...
    ................... (117kB)
    .. (0kB)
    	[SUCCESSFUL ] junit#junit;3.8.2!junit.jar (184ms)
    :: resolution report :: resolve 5367ms :: artifacts dl 2403ms
    	---------------------------------------------------------------------
    	|                  |            modules            ||   artifacts   |
    	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    	---------------------------------------------------------------------
    	|      default     |   13  |   13  |   13  |   0   ||   15  |   15  |
    	---------------------------------------------------------------------
    Dependencies in file ./ivy2.xml were successfully resolved
    
    
    3. Retrieve Dependencies
    
    
    :: retrieving :: apache#hello-ivy
    	confs: [default]
    	0 artifacts copied, 28 already retrieved (0kB/155ms)
    Retrieved 0 dependencies
    `


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message