Looks like your ant code runs too late, you need to run it in an earlier phase 
than deploy, for example "package".

Regards
Leon

Sent from my iPhone

On 17.06.2011, at 12:04, vijendra <[email protected]> wrote:

> I am getting some strange behaviour from Maven-ant publish jar to
> artifactory. 
> 
> When I run maven, it calls all pom files one by one.
> 1)    For osb projects it creates a target folder where osb specific jars are
> placed. Eg: synapseitd-1.0-SNAPSHOT.jar and
> synapseitd-1.0-SNAPSHOT-sources.jar
> 2)    I am using same jar (synapseitd-1.0-SNAPSHOT.jar) to contain osb project
> specific dependencies and all other files/folders etc. Note: this is result
> of ant execution code written inside pom file.
> 3)    If I skip entire ant code also, this jar gets published to artifactory
> based on how pom structure is defined.
> 4)    Problem comes here: The jar gets published to artifactory much before 
> ant
> code executes inside pom.
> 5)    That means jar published to artifactory doesn’t contain other required
> files/folders/dependencies which makes the project complete.
> 6)    Later when ant code inside pom gets executed it completes the same jar
> with all other required files/folders/dependencies which makes the project
> complete.
> 7)    Next time since this jar is available in target folder (if we don’t
> clean) it gets picked up and publish to artifactory. 
> Note : This time only some part gets refreshed with older (other required
> files/folders/dependencies which makes the project complete).and gets
> published to artifactory.
> 
> So 2nd time onwards complete synapseitd-1.0-SNAPSHOT.jar is available in
> Artifactory. But this practice fails after every clean.(maven or ant clean)
> 
> 
> My question here is:
> 
> 1)    Is this a default behaviour of  Maven, Can’t we do anything to fit this
> into our requirement.
> 2)    To try some workaround I tried keeping  File C  “maven code” after  “ant
> build code”, but no help.
> 3)    Please provide me your views and suggestions to handle this situation.
> 4)    Should this be considered as a bug.
> 
> Here is the flow of Maven: File A calls B which intern calls C and so on.
> And publish the data to artifactory.
> 
> A)    File A:
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="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/maven-v4_0_0.xsd";>
>    <modelVersion>4.0.0</modelVersion>
> 
>    <parent>
>         <groupId>com.lchclearnet</groupId>
>         <artifactId>lch-parent</artifactId>
>         <version>1.7</version>
>    </parent>
> 
>    <groupId>com.lchclearnet.esb</groupId>
>    <artifactId>esb-parent</artifactId>
>    <version>1.0-SNAPSHOT</version>
>    <packaging>pom</packaging>
>    <name>ESB Parent</name>
> 
> 
>    <modules>
>        <module>esb-schemas</module>
>        <module>esb-common</module>
>        <module>esb-transformation</module>
>        <module>osb-projects</module>
>        <module>enterprise-applications</module>
>    </modules>
> 
> </project>
> 
> B)    File B:
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="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/maven-v4_0_0.xsd";>
> 
>     <modelVersion>4.0.0</modelVersion>
> 
>     <parent>
>          <groupId>com.lchclearnet.esb</groupId>
>          <artifactId>esb-parent</artifactId>
>          <version>1.0-SNAPSHOT</version>
>     </parent>
> 
>     <groupId>com.lchclearnet.esb.osb</groupId>
>     <artifactId>osb-projects</artifactId>
>     <version>1.0-SNAPSHOT</version>
>     <packaging>pom</packaging>
>     <name>OSB Projects</name>
> 
>     <modules>
>         <module>SynapseITD</module>
>     </modules>
> 
> </project>
> 
> C)    File C:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="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/maven-v4_0_0.xsd";>
>            <modelVersion>4.0.0</modelVersion>
> 
>            <parent>
>                        <groupId>com.lchclearnet.esb.osb</groupId>
>                        <artifactId>osb-projects</artifactId>
>                        <version>1.0-SNAPSHOT</version>
>            </parent>
> 
>            <groupId>com.lchclearnet.esb.osb</groupId>
> 
>            <artifactId>synapseitd</artifactId>
>            <version>1.0-SNAPSHOT</version>
>            <packaging>jar</packaging>
> 
> 
>            <build>
>                        <plugins>
>                                    <plugin>
> 
> <groupId>org.apache.maven.plugins</groupId>
> 
> <artifactId>maven-antrun-plugin</artifactId>
>                                                <version>1.6</version>
>                                                <executions>
>                                                            <execution>
> 
> <id>remote-deploy</id>
> 
> <phase>deploy</phase>
> 
> <configuration>
> 
> 
> <target>
> Here goes the ant code which is only able to build OSB project but can’t
> publish to artifactory.
> 
> 
> </target>
> 
> </configuration>
> 
> <goals>
> 
> <goal>run</goal>
> 
> </goals>
>                                                            </execution>
>                                                </executions>
>                                    </plugin>
>                        </plugins>
>            </build>
> </project>
> 
> 
> Thanks
> Vijendra
> 
> 
> 
> --
> View this message in context: 
> http://maven.40175.n5.nabble.com/Maven-with-ant-build-unable-to-publish-to-artifactory-tp4498307p4498307.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to