留言板

When building a WAR using the plugins-sdk, java sources are also added?

thumbnail
Stef Heyenrath,修改在14 年前。

When building a WAR using the plugins-sdk, java sources are also added?

Junior Member 帖子: 76 加入日期: 08-12-3 最近的帖子
In the build-common-plugin.xml there is a "war" target defined as follows:

<target name="war" depends="compile">
	<mkdir dir="${project.dir}/dist" />

	<if>
		<available file="tmp" />
		<then>
			<property name="docroot.dir" value="tmp" />
		</then>
		<else>
			<property name="docroot.dir" value="docroot" />
		</else>
	</if>

	<delete file="${plugin.file}" />

	<antcall target="clean-portal-dependencies" />

	<if>
		<contains string="${app.server.dir}" substring="glassfish" />
		<then>
			<zip basedir="${docroot.dir}" destfile="${plugin.file}" excludes="**/META-INF/context.xml" />
		</then>
	<else>
			<zip basedir="${docroot.dir}" destfile="${plugin.file}" />
		</else>
	</if>
</target>


Why are *.java files not ignored ? This makes the war file too big if you have a lot of sources !
Marina Glebova,修改在12 年前。

RE: When building a WAR using the plugins-sdk, java sources are also added?

New Member 帖子: 15 加入日期: 12-2-27 最近的帖子
Hi Stef! Have you found out the solution of this problem?
thumbnail
David H Nebinger,修改在12 年前。

RE: When building a WAR using the plugins-sdk, java sources are also added?

Liferay Legend 帖子: 14915 加入日期: 06-9-2 最近的帖子
Liferay does this for all portlets using the SDK.

You can move your source folder outside of docroot/WEB-INF and modify the build.xml to use the alternate location for compiling.
thumbnail
Hitoshi Ozawa,修改在12 年前。

RE: When building a WAR using the plugins-sdk, java sources are also added?

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
Probably because Liferay CE is LGPL so developers are required to distribute their source code with the binary.

One character is just 1 byte. It's very difficult to write a portlet with source that's few megabytes.