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

Support ZIP files #1

Open
GoogleCodeExporter opened this issue Sep 28, 2015 · 13 comments
Open

Support ZIP files #1

GoogleCodeExporter opened this issue Sep 28, 2015 · 13 comments

Comments

@GoogleCodeExporter
Copy link

Some projects are shipped as ZIP files, like GAE...

Would be awesome seeing it downloading it once
http://googleappengine.googlecode.com/files/appengine-java-sdk-1.3.0.zip
then unpacking and slicing it.

VELO

Original issue reported on code.google.com by [email protected] on 8 Feb 2010 at 1:03

@GoogleCodeExporter
Copy link
Author

Hi VELO, love the idea!  

Download and unpack should not be an issue.  When you say slicing it, do you 
mean 
that multiple artifacts may need to get installed into repo from the exploded 
ZIP 
contents?   If that is the case, I guess some configuration would be needed to 
define 
multiple artifacts from a single downloaded resource.  

Please comment back with any comments or how you think something like this 
would 
work.  If you have an example of what artifacts would be created from the GAE 
zip, 
that would be helpful as a target use case.  

Thank You, Robert

Original comment by [email protected] on 8 Feb 2010 at 6:43

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Exactly that....

Right know on flexmojos we do that using a XML  descriptor...
https://docs.sonatype.org/display/FLEXMOJOS/Installing+Flex+SDK+into+maven+repos
itory

But it does need to manually download the flex SDK, you approach seem much more
automated and solid for outsiders....

I think would be a matter of adding the download url on this XML and configure 
your
plugin doing something like:
   <bundle>
       <groupId>org.sonatype.flexmojos</groupId>
       <artifactId>flex-sdk</artifactId>
       <version>1.1.1</version>
       <force>false</force>
   </bundle>

Then it would look find the flex-sdk.xml and read the instructions from it.  
What do
you think?


VELO

Original comment by [email protected] on 8 Feb 2010 at 11:34

@GoogleCodeExporter
Copy link
Author

Thank you for the example.  Once I get the basic project structure working 
properly, 
I'll add this functionality.  I like the XML descriptor concept.  I'll look 
into this 
further.   

Original comment by [email protected] on 9 Feb 2010 at 4:16

@GoogleCodeExporter
Copy link
Author

BTW, do you try to download the artifact from remote repos before you try to 
install it?

I ask that because people may try to use your plugin to overwrite artifacts 
already
available on cental, but doing so it is a very dangerous path.


VELO

Original comment by [email protected] on 9 Feb 2010 at 4:24

@GoogleCodeExporter
Copy link
Author

That is a very good point!  I am checking the local repository before 
downloading, but 
am not first attempting to resolve in remote repositories.   This should be an 
easy 
add!  

Original comment by [email protected] on 9 Feb 2010 at 4:29

@GoogleCodeExporter
Copy link
Author

FWIW, I think you try to resolve the artifact from remote first and fail the 
build if
the checksum doesn't match (when there is a checksum) , but if there is no 
checksum
just print a warning saying you didn't get it from the URL, but from repo.

Original comment by [email protected] on 9 Feb 2010 at 4:35

@GoogleCodeExporter
Copy link
Author

Implemented:  Checksum validation 
see Issue #3
http://code.google.com/p/maven-external-dependency-plugin/issues/detail?id=3

I do throw MojoFailureException which ends the build if a checksum does not 
validate.  I also now try to 
resolve the artifact from all repositories prior to downloading.  

Implemented: Attempt to resolve dependencies in repos before downloading 
see Issue #4
http://code.google.com/p/maven-external-dependency-plugin/issues/detail?id=4

_I think I captured the spirit of what you were suggesting...._

If the artifact can be resolved in a local or remote repository, then this 
plugin does nothing further 
with that artifact.  That artifact will be resolved by the default Maven 
dependency resolver prior to 
compile.  Attempting to go around the Maven resolver to download an artifact 
that is hosted in a Maven 
repository  with this plugin would violate the purpose of this plugin and the 
Maven conventions.  This 
plugin is only intended to pull down non-Maven hosted artifacts.     

Original comment by [email protected] on 11 Feb 2010 at 3:17

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Hi Velo,

FYI, don't have the bundle stuff in yet, but I did look into that and it 
shouldn't be 
too difficult. 

I did add support in the latest build to extract a single artifact from from a 
compressed ZIP download.  See Wiki: Extract_Artifact_From_Downloaded_File

Thanks,
Robert

Original comment by [email protected] on 13 Feb 2010 at 7:05

@GoogleCodeExporter
Copy link
Author

Issue 10 has been merged into this issue.

Original comment by [email protected] on 26 Sep 2010 at 3:42

@GoogleCodeExporter
Copy link
Author

Two comments on the extractFile solution:

1.) Please don't use an external "descriptor file". Having everything in one 
place (pom.xml) is really nice.

2.) Unfortunately, configuring multiple artifactItems that extract files from 
the same downloadUrl is currently quite verbose, even if one uses properties:

<configuration>
  <artifactItems>
    <artifactItem>
      <groupId>org.example</groupId>
      <artifactId>first-artifact</artifactId>
      <version>1.0</version>
      <packaging>jar</packaging>
      <downloadUrl>${download.url}</downloadUrl>
      <extractFile>{artifactId}.{packaging}</extractFile>
    </artifactItem>
    <artifactItem>
      <groupId>org.example</groupId>
      <artifactId>second-artifact</artifactId>
      <version>1.0</version>
      <packaging>jar</packaging>
      <downloadUrl>${download.url}</downloadUrl>
      <extractFile>{artifactId}.{packaging}</extractFile>
    </artifactItem>
  </artifactItems>
</configuration>

It would be nice if one could define a configuration-level groupId, version,  
packaging, and downloadUrl (maybe even extractFile) to which the individual 
artifactItems would then default:

<configuration>
  <groupId>org.example</groupId>
  <version>1.0</version>
  <packaging>jar</packaging>
  <downloadUrl>${download.url}</downloadUrl>
  <artifactItems>
    <artifactItem>
      <artifactId>first-artifact</artifactId>
      <extractFile>{artifactId}.{packaging}</extractFile>
    </artifactItem>
    <artifactItem>
      <artifactId>second-artifact</artifactId>
      <extractFile>{artifactId}.{packaging}</extractFile>
    </artifactItem>
  </artifactItems>
</configuration>

If one wants to apply different defaults to different sets of artifactItems, 
this is easily possible as well; one simply defines several plugin executions.

Original comment by [email protected] on 27 Sep 2010 at 7:27

@GoogleCodeExporter
Copy link
Author

I've implemented caching of downloaded files (patch attached).

The implementation is quite straight-forward. In particular, it doesn't 
introduce any new configuration syntax; it simply avoids superfluous downloads 
when several artifactItems have the same downloadUrl.

Original comment by [email protected] on 19 Feb 2011 at 4:02

Attachments:

@GoogleCodeExporter
Copy link
Author

I've also implemented a defaulting mechanism (patch attached) whereby 
individual artifactItems inherit their groupId, artifactId, version, 
classifier, packaging, downloadUrl and extractFile properties from the plugin's 
configuration (see comment 11).

Defaults are filled in before token substitution takes place, so that 
parameterizing downloadUrl or extractFile works as expected. This allows one to 
considerably shorten the configuration when extracting multiple artifacts from 
one bundle. (IMHO, this also makes external XML descriptors unnecessary.)

Original comment by [email protected] on 19 Feb 2011 at 5:06

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant