Re: maven-dependency-plugin unpacking aar format?

2014-07-21 Thread William Ferguson
So an Android library is packaging WSDL inside itself and is expecting you
to use it at build time?


On Tue, Jul 22, 2014 at 8:53 AM, Martin Gainty  wrote:

> Here is an aar straight from Axis version example:
>
> //layout of version.aar:
>
>created: META-INF/
>   inflated: META-INF/MANIFEST.MF
>created: sample/
>created: sample/axisversion/
>   inflated: sample/axisversion/Version.class
>   inflated: META-INF/services.xml
>
>
> //org.apache.axis2.deployment.DeploymentEngine axis code used to
> populateService with .aar contents:
>
> protected ArrayList populateService(AxisServiceGroup serviceGroup,
> URL servicesURL,
> String serviceName) throws
> DeploymentException {
> try {
> serviceGroup.setServiceGroupName(serviceName);
> ClassLoader serviceClassLoader = Utils.createClassLoader(
> new URL[]{servicesURL},
> axisConfig.getServiceClassLoader(),
> true,
> (File)
> axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR),
> axisConfig.isChildFirstClassLoading());
> String metainf = "meta-inf";
> serviceGroup.setServiceGroupClassLoader(serviceClassLoader);
> //processing wsdl.list
> InputStream wsdlfilesStream =
>
> serviceClassLoader.getResourceAsStream("meta-inf/wsdl.list");
> if (wsdlfilesStream == null) {
> wsdlfilesStream =
> serviceClassLoader.getResourceAsStream("META-INF/wsdl.list");
> if (wsdlfilesStream != null) {
> metainf = "META-INF";
> }
> }
> HashMap servicesMap = new HashMap();
> if (wsdlfilesStream != null) {
> ArchiveReader reader = new ArchiveReader();
> BufferedReader input = new BufferedReader(new
> InputStreamReader(wsdlfilesStream));
> String line;
> while ((line = input.readLine()) != null) {
> line = line.trim();
> if (line.length() > 0 && line.charAt(0) != '#') {
> line = metainf + "/" + line;
> try {
> List services = reader.getAxisServiceFromWsdl(
>
> serviceClassLoader.getResourceAsStream(line),
> serviceClassLoader, line);
> if (services != null) {
> for (Object service : services) {
> AxisService axisService =
> (AxisService) service;
> servicesMap.put(axisService.getName(),
> axisService);
> }
> }
>
> } catch (Exception e) {
> throw new DeploymentException(e);
> }
> }
> }
> }
> InputStream servicexmlStream =
>
> serviceClassLoader.getResourceAsStream("META-INF/services.xml");
> if (servicexmlStream == null) {
> servicexmlStream =
> serviceClassLoader.getResourceAsStream("meta-inf/services.xml");
> } else {
> metainf = "META-INF";
> }
> if (servicexmlStream == null) {
> throw new DeploymentException(
>
> Messages.getMessage(DeploymentErrorMsgs.SERVICE_XML_NOT_FOUND,
> servicesURL.toString()));
> }
> DescriptionBuilder builder = new
> DescriptionBuilder(servicexmlStream, configContext);
> OMElement rootElement = builder.buildOM();
> String elementName = rootElement.getLocalName();
>
> if (TAG_SERVICE.equals(elementName)) {
> AxisService axisService = null;
> String wsdlLocation = "META-INF/service.wsdl";
> InputStream wsdlStream =
>
> serviceClassLoader.getResourceAsStream(wsdlLocation);
> URL wsdlURL = serviceClassLoader.getResource(metainf +
> "/service.wsdl");
> if (wsdlStream == null) {
> wsdlLocation = "META-INF/" + serviceName + ".wsdl";
> wsdlStream = serviceClassLoader
> .getResourceAsStream(wsdlLocation);
> wsdlURL = serviceClassLoader.getResource(wsdlLocation);
> }
> if (wsdlStream != null) {
> WSDL11ToAxisServiceBuilder wsdl2AxisServiceBuilder =
> new WSDL11ToAxisServiceBuilder(wsdlStream,
> null, null);
> File file = Utils.toFile(servicesURL);
> if (file != null && file.exists()) {
> wsdl2AxisServiceBuilder.setCustomWSDLResolver(
> 

RE: maven-dependency-plugin unpacking aar format?

2014-07-21 Thread Martin Gainty
Here is an aar straight from Axis version example:

//layout of version.aar:

   created: META-INF/
  inflated: META-INF/MANIFEST.MF
   created: sample/
   created: sample/axisversion/
  inflated: sample/axisversion/Version.class
  inflated: META-INF/services.xml


//org.apache.axis2.deployment.DeploymentEngine axis code used to 
populateService with .aar contents:

protected ArrayList populateService(AxisServiceGroup serviceGroup,
URL servicesURL,
String serviceName) throws 
DeploymentException {
try {
serviceGroup.setServiceGroupName(serviceName);
ClassLoader serviceClassLoader = Utils.createClassLoader(
new URL[]{servicesURL},
axisConfig.getServiceClassLoader(),
true,
(File) 
axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR),
axisConfig.isChildFirstClassLoading());
String metainf = "meta-inf";
serviceGroup.setServiceGroupClassLoader(serviceClassLoader);
//processing wsdl.list
InputStream wsdlfilesStream =

serviceClassLoader.getResourceAsStream("meta-inf/wsdl.list");
if (wsdlfilesStream == null) {
wsdlfilesStream = 
serviceClassLoader.getResourceAsStream("META-INF/wsdl.list");
if (wsdlfilesStream != null) {
metainf = "META-INF";
}
}
HashMap servicesMap = new HashMap();
if (wsdlfilesStream != null) {
ArchiveReader reader = new ArchiveReader();
BufferedReader input = new BufferedReader(new 
InputStreamReader(wsdlfilesStream));
String line;
while ((line = input.readLine()) != null) {
line = line.trim();
if (line.length() > 0 && line.charAt(0) != '#') {
line = metainf + "/" + line;
try {
List services = reader.getAxisServiceFromWsdl(

serviceClassLoader.getResourceAsStream(line),
serviceClassLoader, line);
if (services != null) {
for (Object service : services) {
AxisService axisService = (AxisService) 
service;
servicesMap.put(axisService.getName(), 
axisService);
}
}

} catch (Exception e) {
throw new DeploymentException(e);
}
}
}
}
InputStream servicexmlStream =

serviceClassLoader.getResourceAsStream("META-INF/services.xml");
if (servicexmlStream == null) {
servicexmlStream = 
serviceClassLoader.getResourceAsStream("meta-inf/services.xml");
} else {
metainf = "META-INF";
}
if (servicexmlStream == null) {
throw new DeploymentException(

Messages.getMessage(DeploymentErrorMsgs.SERVICE_XML_NOT_FOUND,
servicesURL.toString()));
}
DescriptionBuilder builder = new 
DescriptionBuilder(servicexmlStream, configContext);
OMElement rootElement = builder.buildOM();
String elementName = rootElement.getLocalName();

if (TAG_SERVICE.equals(elementName)) {
AxisService axisService = null;
String wsdlLocation = "META-INF/service.wsdl";
InputStream wsdlStream =
serviceClassLoader.getResourceAsStream(wsdlLocation);
URL wsdlURL = serviceClassLoader.getResource(metainf + 
"/service.wsdl");
if (wsdlStream == null) {
wsdlLocation = "META-INF/" + serviceName + ".wsdl";
wsdlStream = serviceClassLoader
.getResourceAsStream(wsdlLocation);
wsdlURL = serviceClassLoader.getResource(wsdlLocation);
}
if (wsdlStream != null) {
WSDL11ToAxisServiceBuilder wsdl2AxisServiceBuilder =
new WSDL11ToAxisServiceBuilder(wsdlStream, null, 
null);
File file = Utils.toFile(servicesURL);
if (file != null && file.exists()) {
wsdl2AxisServiceBuilder.setCustomWSDLResolver(
new AARBasedWSDLLocator(wsdlLocation, file, 
wsdlStream));
wsdl2AxisServiceBuilder.setCustomResolver(
new AARFileBasedURIResolver(file));

Re: maven-dependency-plugin unpacking aar format?

2014-07-21 Thread David Hoffer
It has resources specified by the includes that are needed by a different
sub-system of the build.  Some are in jars but lots are in aars too.

META-INF/*.wsdl,META-INF/schema/**/*.xsd


On Mon, Jul 21, 2014 at 3:56 PM, William Ferguson <
william.fergu...@xandar.com.au> wrote:

> David, what the use case for unpacking the AAR?
>
>
> William
>
>
> On Tue, Jul 22, 2014 at 7:27 AM, David Hoffer  wrote:
>
> > Here is a simplified project showing my use-case, I hope this helps.
>  Note
> > I'm using unpack-dependencies as the aar is a module in the same project;
> > however I assume the same problem exists with unpack, if that's the case
> > that would make the test project even simpler.
> >
> > 
> >
> > http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
> > http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
> > http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/xsd/maven-4.0.0.xsd";>
> >
> > 4.0.0
> >
> > com.company.project
> > service
> > 1.0-SNAPSHOT
> >
> > pom
> >
> > 
> > 
> > 
> > com.company.project
> > axis-service
> > aar
> > 1.0-SNAPSHOT
> > 
> > 
> > 
> > com.helpshift
> > android-aar
> > 3.4.2
> > aar
> > 
> > 
> >
> > 
> > 
> > 
> > org.apache.maven.plugins
> > maven-dependency-plugin
> > 
> > 
> > unpack-axis-service
> > generate-resources
> > 
> > unpack-dependencies
> > 
> > 
> >
> > axis-service
> >
> >
> >
> ${project.build.directory}/generated-resources/axis
> > true
> > true
> >
> > META-INF/*.wsdl,META-INF/schema/**/*.xsd
> > 
> > 
> > 
> > 
> > 
> > 
> >
> > 
> >
> >
> >
> > On Mon, Jul 21, 2014 at 3:05 PM, Karl Heinz Marbaise 
> > wrote:
> >
> > > HI David,
> > >
> > >
> > >
> > > > I'm getting the following error trying to unpack some files from an
> > aar.
> > >
> > >>   Is this not supported?  Is there any way to do this?
> > >>
> > >> Failed to execute goal
> > >>
> org.apache.maven.plugins:maven-dependency-plugin:2.8:unpack-dependencies
> > >> (unpack-service) on project service: Unknown archiver type: No such
> > >> archiver: 'aar'. -> [Help 1]
> > >>
> > >
> > > Could you please prepare a example project which reproduces the
> > > problem..so i can create a JIRA issue for this...
> > >
> > > Kind regards
> > > Karl-Heinz Marbaise
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > > For additional commands, e-mail: users-h...@maven.apache.org
> > >
> > >
> >
>


Re: maven-dependency-plugin unpacking aar format?

2014-07-21 Thread William Ferguson
David, what the use case for unpacking the AAR?


William


On Tue, Jul 22, 2014 at 7:27 AM, David Hoffer  wrote:

> Here is a simplified project showing my use-case, I hope this helps.  Note
> I'm using unpack-dependencies as the aar is a module in the same project;
> however I assume the same problem exists with unpack, if that's the case
> that would make the test project even simpler.
>
> 
>
> http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
> http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>
> 4.0.0
>
> com.company.project
> service
> 1.0-SNAPSHOT
>
> pom
>
> 
> 
> 
> com.company.project
> axis-service
> aar
> 1.0-SNAPSHOT
> 
> 
> 
> com.helpshift
> android-aar
> 3.4.2
> aar
> 
> 
>
> 
> 
> 
> org.apache.maven.plugins
> maven-dependency-plugin
> 
> 
> unpack-axis-service
> generate-resources
> 
> unpack-dependencies
> 
> 
>
> axis-service
>
>
> ${project.build.directory}/generated-resources/axis
> true
> true
>
> META-INF/*.wsdl,META-INF/schema/**/*.xsd
> 
> 
> 
> 
> 
> 
>
> 
>
>
>
> On Mon, Jul 21, 2014 at 3:05 PM, Karl Heinz Marbaise 
> wrote:
>
> > HI David,
> >
> >
> >
> > > I'm getting the following error trying to unpack some files from an
> aar.
> >
> >>   Is this not supported?  Is there any way to do this?
> >>
> >> Failed to execute goal
> >> org.apache.maven.plugins:maven-dependency-plugin:2.8:unpack-dependencies
> >> (unpack-service) on project service: Unknown archiver type: No such
> >> archiver: 'aar'. -> [Help 1]
> >>
> >
> > Could you please prepare a example project which reproduces the
> > problem..so i can create a JIRA issue for this...
> >
> > Kind regards
> > Karl-Heinz Marbaise
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >
>


Re: maven-dependency-plugin unpacking aar format?

2014-07-21 Thread David Hoffer
Here is a simplified project showing my use-case, I hope this helps.  Note
I'm using unpack-dependencies as the aar is a module in the same project;
however I assume the same problem exists with unpack, if that's the case
that would make the test project even simpler.



http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd";>

4.0.0

com.company.project
service
1.0-SNAPSHOT

pom




com.company.project
axis-service
aar
1.0-SNAPSHOT



com.helpshift
android-aar
3.4.2
aar






org.apache.maven.plugins
maven-dependency-plugin


unpack-axis-service
generate-resources

unpack-dependencies



axis-service

${project.build.directory}/generated-resources/axis
true
true

META-INF/*.wsdl,META-INF/schema/**/*.xsd











On Mon, Jul 21, 2014 at 3:05 PM, Karl Heinz Marbaise 
wrote:

> HI David,
>
>
>
> > I'm getting the following error trying to unpack some files from an aar.
>
>>   Is this not supported?  Is there any way to do this?
>>
>> Failed to execute goal
>> org.apache.maven.plugins:maven-dependency-plugin:2.8:unpack-dependencies
>> (unpack-service) on project service: Unknown archiver type: No such
>> archiver: 'aar'. -> [Help 1]
>>
>
> Could you please prepare a example project which reproduces the
> problem..so i can create a JIRA issue for this...
>
> Kind regards
> Karl-Heinz Marbaise
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: maven-dependency-plugin unpacking aar format?

2014-07-21 Thread Dan Tran
this may help
http://stackoverflow.com/questions/15393110/maven-custom-archive-extension-how-do-i-use-unpack-dependencies


On Mon, Jul 21, 2014 at 2:05 PM, Karl Heinz Marbaise 
wrote:

> HI David,
>
>
>
> > I'm getting the following error trying to unpack some files from an aar.
>
>>   Is this not supported?  Is there any way to do this?
>>
>> Failed to execute goal
>> org.apache.maven.plugins:maven-dependency-plugin:2.8:unpack-dependencies
>> (unpack-service) on project service: Unknown archiver type: No such
>> archiver: 'aar'. -> [Help 1]
>>
>
> Could you please prepare a example project which reproduces the
> problem..so i can create a JIRA issue for this...
>
> Kind regards
> Karl-Heinz Marbaise
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: maven-dependency-plugin unpacking aar format?

2014-07-21 Thread Karl Heinz Marbaise

HI David,


> I'm getting the following error trying to unpack some files from an aar.

  Is this not supported?  Is there any way to do this?

Failed to execute goal
org.apache.maven.plugins:maven-dependency-plugin:2.8:unpack-dependencies
(unpack-service) on project service: Unknown archiver type: No such
archiver: 'aar'. -> [Help 1]


Could you please prepare a example project which reproduces the 
problem..so i can create a JIRA issue for this...


Kind regards
Karl-Heinz Marbaise

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



maven-dependency-plugin unpacking aar format?

2014-07-21 Thread David Hoffer
I'm getting the following error trying to unpack some files from an aar.
 Is this not supported?  Is there any way to do this?

Failed to execute goal
org.apache.maven.plugins:maven-dependency-plugin:2.8:unpack-dependencies
(unpack-service) on project service: Unknown archiver type: No such
archiver: 'aar'. -> [Help 1]

-Dave


Setting java.library.path in surefire/maven/netbeans

2014-07-21 Thread Alexander
I would like to test my JAI enabled application, but seem to be getting errors 
when accessing the JAI components. I suspect this is caused by the absence of 
native support. I tried setting the java.library.path using systemProperties as 
well as argLine, however none of these options result in the change appearing 
in the surefire report.

pom.xml
---
  
org.apache.maven.plugins
maven-surefire-plugin
2.17
  
  -Djava.library.path=/usr/lib64/sun-jai-bin/

  

surefire-report
===


I am using netbeans (v8) and surefire 2.17.

Thanks
Alex