Ben,
I too am having issues with 2 TLD's not being in the jar and as such can
not test the snapshot unfortunately.
I skimmed through the subversion repository and now appreciate why its
been difficult to deal with M2 for you guys... the project layout is
some custom format and your primary build is ant and things are all over
the place (from a M2 perspective ;-) ... . So I guess you are now
trying to shoehorn the M2 stuff w/o breaking the Ant builds which I
presume the core dev team is using. OK... well... I don't know if this
helps but in your build.xml you have:
<copy todir="${classes.dir}">
<fileset dir="${src.dir}">
<include name="**/*.properties"/>
</fileset>
</copy>
<!-- make two copies of the taglib, one with and one without dynamic
attributes -->
<filter filtersfile="${tld.dir}/common-descriptions.properties"/>
<filter token="dynattrs" value="false"/>
<copy file="${tld.dir}/stripes.tld" todir="${classes.dir}/META-INF"
filtering="true"/>
<filter token="dynattrs" value="true"/>
<copy file="${tld.dir}/stripes.tld"
tofile="${classes.dir}/META-INF/stripes-dynattr.tld" filtering="true"/>
<replace file="${classes.dir}/META-INF/stripes-dynattr.tld"
token="http://stripes.sourceforge.net/stripes.tld"
value="http://stripes.sourceforge.net/stripes-dynattr.tld"/>
First thing is to make sure that things in "resources" end up in the
classes folder:
<build>
<defaultGoal>package</defaultGoal>
<sourceDirectory>stripes/src</sourceDirectory>
<outputDirectory>stripes/classes</outputDirectory>
<testSourceDirectory>tests/src</testSourceDirectory>
<testOutputDirectory>tests/classes</testOutputDirectory>
<resources>
<resource>
<directory>stripes/resources</directory>
<excludes>
<exclude>*.tld</exclude>
</excludes>
</resource>
</resources>
<directory>stripes/dist</directory>
Now you should notice that I excluded TLD's in the above... the ideal
scenario would be that your TLDs would readily be located under
stripes/resources/META-INF/ and then the above would drop them it into
place (assuming you removed the excludes tags).
But alas we are not so lucky not to mention the fact that the dynamic
stripes TLD is generated by being copied from stripes.tld and we have
some minor challenges. Here is what I came up with:
Step 1: Get the TLD files somewhere temporary so that we can filter
them and copy them to where they will end up.... (YES - this is no joke
there really is no great way to copy a resource with M2 as all resources
/ things are expected to be in place - but this not necessarily a kludge
either it is just leveraging the right tool for the job):
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<tasks>
<copy file="stripes/resources/stripes.tld"
tofile="stripes/TMP/stripes.tld"/>
<copy file="stripes/resources/stripes.tld"
tofile="stripes/TMP/stripes-dynattr.tld"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
Step 2: Copy the TLDs to stripes/classes/META-INF/ and filter them for
any changes
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.2</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>process-resources</phase>
<configuration>
<outputDirectory>stripes/classes/META-INF/</outputDirectory>
<resources>
<resource>
<directory>stripes/TMP/</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
I removed the goals in the above which I hope is still valid and used
phases to have the steps executed in lock-step but again have not tested.
Lastly, check out the following to do filtering:
http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html
Of course the above is done by hand and I have NOT tested it but it
should give you a good start (I hope) to get this done.
Also these resources may help:
http://maven.apache.org/plugins/maven-resources-plugin/examples/copy-resources.html
http://maven.apache.org/guides/mini/guide-building-for-different-environments.html
http://stackoverflow.com/questions/512516/how-to-copy-from-one-file-to-another-in-maven
http://maven.apache.org/plugins/maven-resources-plugin/
HTH.
--Nikolaos
Iwao AVE! wrote:
Ben,
Thank you very much for your time.
Publishing snapshots makes it much easier for us to test the latest
fix/feature in our existing solution.
Besides the 'tools.jar' dependency issue Nikolaos had reported, the
TLD files seem to be missing from the 1.5.4-SNAPSHOT.jar.
I may be able to do more tests later.
Regards,
Iwao
on 10/05/18 11:28 Ben Gunter said the following:
I have been working since last week on getting Stripes into the
Sonatype repository. I know virtually nothing about Maven so it's
been a challenge. I have a 1.5.4 snapshot in there right now. I'm
still trying to figure out what all I need to do to deploy releases.
In the meantime, I'll push snapshots whenever something interesting
gets added or fixed. Here's the URL to the snapshot repository, I think.
http://oss.sonatype.org/content/repositories/snapshots/
-Ben
------------------------------------------------------------------------------
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development
------------------------------------------------------------------------------
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development